Docker Community Forums

Share and learn in the Docker community.

Docker is not automaticly restaring containers on reboot. [Ubuntu 14.04]


(Oppsig) #1

I’m running distribution Ubuntu 14.04, and my previously running docker containers is not starting up automaticly after reboot.

I think the problem started happening after I replaced the docker.io package in the ubuntu repositories with lxc-docker-1.2.0 package from ppa.

The docker deamon itself is starting fine, and also containers start with the command: docker start .

I don’t got deb diff installed, but are there any configuration differences between docker.io and lxc-docker?

Link to /etc/default/docker
Link to /etc/init/docker.conf

Thanks in advance.


(Sam Saffron) #2

When you launched it did you specify a restart policy?


(Sven Dowideit) #3

@oppsig, @sam is pointing you to http://docs.docker.com/reference/commandline/cli/#restart-policies :smile:


(Oppsig) #4

Ok maybe I misunderstood, but isn’t it default docker behaviour to start previously running containers that were running when you did a shutdown on your computer?

I didnt supply any --restart flag when i created the containers.


(Sam Saffron) #5

It switch back on forth on this one, at the moment, you need to be explicit.


(Oppsig) #6

OK, that could explain why it worked when i used docker around version 0.9 but no longer at version 1.2+.

Anyway, i tried like you suggested to set --restart=“always” flag on all my containers and now it works perfectly.
They start when i start my computer. So i guess the logic is now that as long as docker starts, the containers should also start.
I had to do it this way because using the default upstart script was unreliable, sometimes the containers would start sometimes not.

Thanks for all the help :smile: