运行django tutorial for docker compose,但是初始化django项目的命令没有按预期工作。
$ docker-compose run web django-admin.py startproject composeexample .
[31mERROR[0m: Interactive mode is not yet supported on Windows.
Please pass the -d flag when using `docker-compose run`.
在windows" interactive"模式不受支持所以我修改了命令以运行"分离"模式。
$ docker-compose run -d web django-admin.py startproject composeexample .
Creating network "djangotest_default" with the default driver
...
Successfully built 0fb90648c1d8
[33mWARNING[0m: Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
djangotest_web_run_1
这似乎创建了框..但我当前的目录显示没有新文件(来自django-admin命令)。
$ ls
docker-compose.yml Dockerfile requirements.txt
如何让容器输出与预期的当前工作目录同步?
答案 0 :(得分:0)
修复是卸载Windows 10并安装* nix系统。然后按照教程显示文件。
~/docker/django-test $ ll
total 60
drwxr-xr-x 4096 Sep 24 00:47 ./
drwxr-xr-x 4096 Sep 24 00:40 ../
drwxr-xr-x 4096 Sep 24 00:47 composeexample/
-rw-r--r-- 209 Sep 24 00:41 docker-compose.yml
-rw-r--r-- 146 Sep 24 00:41 Dockerfile
-rwxr-xr-x 812 Sep 24 00:47 manage.py*
-rw-r--r-- 16 Sep 24 00:41 requirements.txt