我正在构build一个基于标准Ubuntu 14.04映像的新Docker镜像。
这是我的Dockerfile :
FROM ubuntu:14.04 RUN apt-get update -y RUN apt-get install -y nginx git python-setuptools python-dev RUN easy_install pip ADD . /code WORKDIR /code RUN pip install -r requirements.txt # only 'django' for now ENV projectname myproject EXPOSE 80 8000 WORKDIR ${projectname} CMD ['python', 'manage.py', 'runserver', '0.0.0.0:80']
当我尝试运行这个图像,我得到这个错误…
/ bin / sh:1:[python,:not found
但是,如果我在运行映像时打开一个shell,运行python
按预期打开交互式提示。
为什么我不能在Dockerfile中通过CMD
调用python
?
在CMD中使用"
而不是'
(文档)