正在 docker 项目中保存更改

Saving changes in docker project

我刚刚用 docker 开始了一个 django 项目,我使用了书中讨论的 cookiecutter-django template 两勺 django。

我正在尝试在 OSX 中进行全部设置,但我在使用文档中的 following part 时遇到了一些问题:

Saving changes

If you are using OS X or Windows, you need to create a /data partition inside the virtual machine that runs the docker deamon in order make all changes persistent. If you don’t do that your /data directory will get wiped out on every reboot. To create a persistent folder, log into the virtual machine by running:

$ docker-machine ssh dev1

$ sudo su

$ echo 'ln -sfn /mnt/sda1/data /data' >> /var/lib/boot2docker/bootlocal.sh

但是,如果我执行这些命令并尝试启动我的 docker 项目,我会收到以下错误:

错误:无法启动容器 182a38022fbdf65f7a64f1ca5475a3414084d11c91f1cb48bffc6f76491baf4a:mkdir /data:文件存在

我现在很困惑,你们知道我可以做些什么来解决这个问题 运行 吗?

所以最后这个问题是通过在本地机器上创建目录来解决的。在将行添加到 bootlocal.sh 文件时,我使用以下代码完成了此操作:

$ mkdir /mnt/sda1/data