Giter VIP home page Giter VIP logo

Comments (6)

jonozw avatar jonozw commented on August 23, 2024 2

搞定了, 还是Docker不熟悉, 搞清楚了Entrypoint和CMD的关系, 就行了

docker run -itd --restart always --network host --hostname frpc --name frpc --volume /opt/volumes/frp:/etc/frp
--entrypoint=/usr/bin/frpc
snowdreamtech/frpc:0.46.0
--config_dir /etc/frp/client-config

from frp.

snowdream avatar snowdream commented on August 23, 2024

可以把配置文件挂载到容器内部。

from frp.

jonozw avatar jonozw commented on August 23, 2024

比方说xray的docker, 用的是
CMD [ "/usr/bin/xray", "-config", "/etc/xray/config.json" ]
这样如果我希望修改命令行, 我可以在最后用自行定义的命令行

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 /usr/bin/frpc -c /etc/frp/frpc.ini

没法用自定义命令来更改, 请问用Entrypoint而不用CMD的用意是什么啊?
Docker不太熟悉, 也许问题太小白了, 见谅.

from frp.

snowdream avatar snowdream commented on August 23, 2024
  1. frp 的配置主要在配置文件中。
  2. 你可以尝试在 docker run 命令后加上你需要的参数尝试。
  3. 更多自定义需求,可以修改自己的 Dockerfile,创建自己的docker 镜像。

from frp.

jonozw avatar jonozw commented on August 23, 2024

嗯嗯, 不行就自己修改Dockerfile了, 谢谢

from frp.

jonozw avatar jonozw commented on August 23, 2024

研究了一下 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 behavior

ENTRYPOINT /usr/bin/frpc

default options

CMD [ "-c", "/etc/frp/frpc.ini" ]

from frp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.