我建立一个小的Python(瓶)的应用程序。
图像被成功建立,但容器没有运行。当我运行docker ps
,没有正在运行的集装箱被发现。此外搬运工日志显示uwsgi not found
IDE N体dock.朋友:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_docker():
return 'Hellow docker!\n'
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
Dockerfile:
FROM python:3.6
RUN pip install Flask==0.10.1
RUN pip install uWSGI==2.0.17
WORKDIR /app
COPY app /app
CMD ["uwsgi", "--http", "0.0.0.0:9090". "--wsgi-file",
"/app/identidock.py", "--callable", "app", "--stats", "0.0.0.0:9191"]
运行命令:
sudo docker build -t identidock . <<< no problem
sudo docker run -d -p 9090:9090 -p 9191:9191 identidock << no problem
sudo docker ps << empty
sudo docker logs <container ID> > >>/bin/sh: 1: [uwsgi,: not found
如果你正在构建与这一行CMD ["uwsgi", "--http", "0.0.0.0:9090". "--wsgi-file", "/app/identidock.py", "--callable", "app", "--stats", "0.0.0.0:9191"]
码头工人的形象,你有"0.0.0.0:9090"
后一个点,你需要通过,
改变。
泊坞窗文件应该是:
FROM python:3.6
RUN pip install Flask==0.10.1
RUN pip install uWSGI==2.0.17
WORKDIR /app
COPY app /app
CMD ["uwsgi", "--http", "0.0.0.0:9090", "--wsgi-file", "/app/identidock.py", "--callable", "app", "--stats", "0.0.0.0:9191"]
这应该工作...