Docker Container management in production environm

2019-08-07 21:39发布

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条回答
你好瞎i
2楼-- · 2019-08-07 21:47

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.

查看更多
登录 后发表回答