Docker集装箱管理在生产环境中 [英] Docker Container management in production environment
问题描述
如果他们应该错误/关闭/ etc?
另外,如果许多函数必须通过docker运行命令完成,比如说例如卷挂载或链接,那么如何才能完成整个容器的完整配置没有使用码头组合的应用程序? (因为他们说没有准备就绪)
什么机制用于重新启动docker容器如果他们错误/关闭/ etc?
Docker重新启动策略,设置为 - restart
code> docker run 。从 docker-run(1)
手册页:
restart =
pre>
重新启动一个容器退出时应用的策略(no,on-fail-
ure [:max-retry],总是)
此外,如果许多功能必须通过docker运行命令完成,比如说音量挂起或链接,完成一个应用程序而不使用docker组合的整个容器集群?
嗯,你当然可以使用
docker-compose
如果这是最符合您要求的,即使没有标记为生产就绪。
您可以调查较大的集装箱管理解决方案,如 Kubernetes 甚至 OpenStack (虽然我不会推荐后者,除非你已经熟悉Ope nStack)。
您可以为每个容器制作单独的systemd单元文件。
Maybe I missed something in the Docker documentation, but I'm curious and can't find an answer:
What mechanism is used to restart docker containers if they should error/close/etc?
Also, if many functions have to be done via a docker run command, say for instance volume mounting or linking, how does one bring up an entire hive of containers which complete an application without using docker compose? (as they say it is not production ready)
解决方案What mechanism is used to restart docker containers if they should error/close/etc?
Docker restart policies, as set with the
--restart
option todocker run
. From thedocker-run(1)
man page:--restart="" Restart policy to apply when a container exits (no, on-fail‐ ure[:max-retry], always)
Also, if many functions have to be done via a docker run command, say for instance volume mounting or linking, how does one bring up an entire hive of containers which complete an application without using docker compose?
Well, you can of course use
docker-compose
if that is the best match for your requirements, even if it is not labelled as "production ready".You can investigate larger container management solutions like Kubernetes or even OpenStack (although I would not recommend the latter unless you are already familiar with OpenStack).
You could craft individual systemd unit files for each container.
这篇关于Docker集装箱管理在生产环境中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!