尽管有Docker的Interactive教程和常见问题解答,但当容器退出时,我仍然丢失了数据。
我已经按照以下说明安装了Docker:http : //docs.docker.io/en/latest/installation/ubuntulinux 在ubuntu 13.04上没有任何问题。
但是退出时它将丢失所有数据。
iman@test:~$ sudo docker version
Client version: 0.6.4
Go version (client): go1.1.2
Git commit (client): 2f74b1c
Server version: 0.6.4
Git commit (server): 2f74b1c
Go version (server): go1.1.2
Last stable version: 0.6.4
iman@test:~$ sudo docker run ubuntu ping
2013/10/25 08:05:47 Unable to locate ping
iman@test:~$ sudo docker run ubuntu apt-get install ping
Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
iputils-ping
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 56.1 kB of archives.
After this operation, 143 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ precise/main iputils-ping amd64 3:20101006-1ubuntu1 [56.1 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 56.1 kB in 0s (195 kB/s)
Selecting previously unselected package iputils-ping.
(Reading database ... 7545 files and directories currently installed.)
Unpacking iputils-ping (from .../iputils-ping_3%3a20101006-1ubuntu1_amd64.deb) ...
Setting up iputils-ping (3:20101006-1ubuntu1) ...
iman@test:~$ sudo docker run ubuntu ping
2013/10/25 08:06:11 Unable to locate ping
iman@test:~$ sudo docker run ubuntu touch /home/test
iman@test:~$ sudo docker run ubuntu ls /home/test
ls: cannot access /home/test: No such file or directory
我还通过相同结果的交互式会话对其进行了测试。我忘记了什么吗?
编辑:对于新DOCKER用户的重要
正如@ mohammed-noureldin和其他人所说,实际上这不是退出的容器。每次它只是创建一个新的容器。
Docker
。我建议保留标题和原始问题,因为初学者肯定会搜索类似的内容。但是,为什么不在撰写本文时添加一些描述您的误解的内容。这将有助于弄清楚事情。这就是我们这里的文化...不是吗?:-)