我是docker和bluemix的新手,并尝试在bluemix上部署我的应用程序。我想在卷中添加应用程序配置文件,以便所有容器都可以读取相同的配置文件。
我按照bluemix给出的所有步骤 - https://console.ng.bluemix.net/docs/containers/container_volumes_mount.html
这些是我执行的命令 -
cf ic volume create myvolume
OK
The volume 'myvolume' was created.
cf ic volume list
myVolume
cf ic run --volume myvolume:/usr/xyz--name singleVolContainer registry.portal.bluemix.net/my_services/dockerexample:1.0
8aad1ab7-42c3-2344-890b-0a345eb6d74c
cf ic cp ./config.properties 8aad1ab7-42c:/usr/xyz
cf ic exec -it 8aad1ab7-42c bash
cd /usr/xyz
bash: cd: /usr/xyz: Not a directory
现在,它不是将文件复制到xyz目录,而是将文件内容复制到名为" xyz"的新文件中。
我做错了什么?
如何将文件复制到卷中,如何检查容器是否能够以卷的形式读取文件?
已添加 -
我在运行实例后运行df命令并给了我以下输出(没有安装卷) -
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/docker-252:0-28311560-283985acbf138a13244821e88ff85f7b04b80938076a02c4d64cb1efa9923986 10190136 399364 9250100 5% /
tmpfs 14409504 0 14409504 0% /dev
tmpfs 14409504 0 14409504 0% /sys/fs/cgroup
/dev/mapper/kraken--host--01--vg-root 744810064 111867496 595085288 16% /etc/hosts
shm 65536 0 65536 0% /dev/shm
udev 14398352 12 14398340 1% /dev/tty
添加更多内容 -
我想我找到了问题 -
cf ic volume create volnew
OK
The volume 'volnew' was created.
cf ic volume fs-inspect volnew
FAILED
{
"code": "IC5000E",
"description": "An issue occurred in IBM Containers. Contact Bluemix Support and reference this incident ID.",
"incident_id": "some_id",
"name": "DefaultMessage",
"rc": "500",
"type": "General"
}
更多信息
cf ic volume fs-list
Name Size IOPS/GB Created State
4c334ff9-a516-46c8-92df-c5cadbd7f6ff 0 0.00 2016-11-02 14:41:34 ERROR-('Connection aborted.', error(111, 'ECONNREFUSED'))
Dockerfile
FROM tomcat:8.0
MAINTAINER abc
ADD settings.xml /usr/local/tomcat/conf/
ADD tomcat-users.xml /usr/local/tomcat/conf/
ADD RESTfulExample.war /usr/local/tomcat/webapps/