简体   繁体   English

如何在docker容器中运行puppet agent来构建它。 我该如何实现这一目标?

[英]How do I run puppet agent inside a docker container to build it out. How do I achieve this?

If I run a docker container with CMD["/use/sbin/ssh", "-D"] , I can have them running daemonized, which is good. 如果我使用CMD["/use/sbin/ssh", "-D"]运行一个docker容器,我可以让它们运行daemonized,这很好。 Then, I want to run puppet agent too, to build our said container as say an apache server. 然后,我也想运行puppet agent,构建我们所说的容器,如apache服务器。

Is it possible to do this and then expose the apache server? 是否可以执行此操作然后公开Apache服务器?

Here is another solution. 这是另一种解决方案。 We use ENTRYPOINT docker file instruction as described here: https://docs.docker.com/articles/dockerfile_best-practices/#entrypoint . 我们使用ENTRYPOINT docker文件指令,如下所述: https ://docs.docker.com/articles/dockerfile_best-practices/#entrypoint。 Using it you can run puppet agent and other services in background before instruction from CMD or command passed via docker run. 使用它可以在CMD指令或通过docker run传递的命令之前在后台运行puppet agent和其他服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM