gpt4 book ai didi

docker - 用空格覆盖 docker 入口点

转载 作者:行者123 更新时间:2023-12-02 17:58:58 25 4
gpt4 key购买 nike

我正在尝试使用 覆盖 docker 入口点 docker 运行 .这适用于 docker-compose:

  myapp:
build: .
security_opt:
- seccomp:unconfined
entrypoint: dlv debug local/myorg/myapp -l 0.0.0.0:2345 --headless=true --log=true --server
volumes:

使用:
docker run --entrypoint "dlv debug local/myorg/myapp -l 0.0.0.0:2345 --headless=true --log=true --server"

结果是:
exec: \"dlv debug local/myorg/myapp -l 0.0.0.0:2345 --headless=true --log=true --se
rver\": stat dlv debug local/myorg/myapp -l 0.0.0.0:2345 --headless=true --log=true --server: no such file or directory

最佳答案

查看 How to properly override the ENTRYPOINT using docker run 的文章“Adrian Oprea” .

The documentation clearly states that the ENTRYPOINT only specifies the executable to run, when the container starts.

There is something a bit counter-intuitive here and if you take a good look at the example commands on the documentation page, you’ll see that the arguments are being passed after the image name.


在你的情况下:
 docker run --entrypoint dlv YOUR_IMAGE_NAME debug local/myorg/myapp -l 0.0.0.0:2345 --headless=true --log=true --server
^^^^^^^^^^^^^^^

关于docker - 用空格覆盖 docker 入口点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49951482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com