-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问为什么用Entrypoint而不用CMD呢? #27
Comments
可以把配置文件挂载到容器内部。 |
比方说xray的docker, 用的是 docker run -itd --restart always --network host --hostname xray --name xray.1.7.2 --volume /opt/volumes/xray:/etc/xray teddysun/xray:1.7.2 /usr/bin/xray -confdir /etc/xray/conf.d 来覆盖原有CMD, 执行自定义的命令 但是现在frpc用的是Entrypoint 没法用自定义命令来更改, 请问用Entrypoint而不用CMD的用意是什么啊? |
|
嗯嗯, 不行就自己修改Dockerfile了, 谢谢 |
研究了一下 Entrypoint和CMD The ENTRYPOINT gives a container its default nature or behavior, so that when you set an ENTRYPOINT you can run the container as if it were that binary, complete with default options, and you can pass in more options via the COMMAND. 所以, 我个人觉得写成这样可能更符合Docker的文档 default nature or behaviorENTRYPOINT /usr/bin/frpc default optionsCMD [ "-c", "/etc/frp/frpc.ini" ] |
搞定了, 还是Docker不熟悉, 搞清楚了Entrypoint和CMD的关系, 就行了 docker run -itd --restart always --network host --hostname frpc --name frpc --volume /opt/volumes/frp:/etc/frp |
我想用 --config_dir 这样启动, 但是没有CMD搞不定
可能是我Docker不熟悉...
The text was updated successfully, but these errors were encountered: