Docker Community Forums

Share and learn in the Docker community.

Docker container autostart


(Hipols) #1

Hi people! Help me please!

Docker version:
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef

System:
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty

I’m going to run a lot of containers and I need to be constantly working. But when the container is for some reason stopped, it will automatically run. What tools do I use? Thank you!


(Usertaken) #2

Including --restart always will always try to keep your container running.

https://docs.docker.com/reference/run/#restart-policies-restart


(Hipols) #3

Thank you. But to me, this function is not suitable. If you kill a container or it completes its work on a critical error, this function does not restore it.


(Usertaken) #4

For finer control you can look into managing Docker containers with Systemd.

https://coreos.com/docs/launching-containers/launching/getting-started-with-systemd/
http://container-solutions.com/2015/04/running-docker-containers-with-systemd/


(Hipols) #5

usertaken Thank you. I think it will come. Will be tested.