0

我试图在运行 docker 映像时提供动态端口、线程和工作人员,但出现错误

[root]# docker run -it  -p 8080:8080  --env-file ./env.list  ff50c09659a0
/usr/bin/gunicorn: line 4: import: command not found
/usr/bin/gunicorn: line 5: import: command not found
/usr/bin/gunicorn: line 7: from: command not found
/usr/bin/gunicorn: gunicorn: line 10: syntax error near unexpected token `('
/usr/bin/gunicorn: gunicorn: line 10: `    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])'

在 docker 文件中,我使用的是 ENTRYPOINT

ENTRYPOINT ["/bin/bash","gunicorn","-b :","$port","-w","$worker","-t","$thread","--graceful-timeout","$time","api:APP"]

谁能建议我为什么会收到此错误?

4

1 回答 1

0

嘿,伙计们,只需更改 ENTRYPOINT 即可解决

ENTRYPOINT ["/bin/bash","-c","gunicorn -b :$port -w $worker -t $thread --timeout 300 --graceful-timeout $time api:APP"]
于 2018-06-14T12:51:53.027 回答