Docker Container management in production environment

限于喜欢 提交于 2020-01-06 02:11:28

问题


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)


回答1:


What mechanism is used to restart docker containers if they should error/close/etc?

Docker restart policies, as set with the --restart option to docker run. From the docker-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.



来源:https://stackoverflow.com/questions/29502114/docker-container-management-in-production-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!