如何在gunicorn docker中添加动态端口号?

时间:2018-06-14 10:24:39

标签: docker gunicorn docker-entrypoint

我正在尝试在运行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"]

有人能说明为什么我会收到此错误吗?

1 个答案:

答案 0 :(得分:0)

嘿家伙只是通过更改ENTRYPOINT来解决问题

{{1}}