使用:
CMD ["$(pipenv --venv)/bin/python3", "main.py", "/root/uploads"]
导致docker run
错误:
Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"$(pipenv --venv)/bin/python3\\\": stat $(pipenv --venv)/bin/python3: no such file or directory\"\n"
有没有办法在CMD部分进行评估命令替换,如$(pipenv --venv)/bin/python3
?
答案 0 :(得分:1)
将其更改为
CMD ["bash", "-c", "$(pipenv --venv)/bin/python3 main.py /root/uploads"]
如果仍有问题,请将$
更改为$$