docker run -d --restart always --name=jdownloader-2 -p 5800:5800 jlesage/jdownloader-2
Unfortunately, after a docker host restart (so, Linux restart) the container comes not back automatically. I thought with switch --restart always it should but it doesn’t.
Until I hit the command “docker ps -a” the container does not run.
I thought that --restart always does that as well but on my linux box (used as docker host) it does not work as expected
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
96b7f8fe1e31 jlesage/jdownloader-2 “/init” 21 hours ago Up Less than a second 3129/tcp, 5900/tcp, 0.0.0.0:5800->5800/tcp jdownloader-2
So, as you can see the system is up for 22min already but the container just starts in case I hit the command “docker ps -a” ???
This looks very curious to me and I face this behavior on another ubuntu based linux as well.
This does not make sense to me. Is there something I missed apart from a default docker setup? Does it need further tuning to work as expected?
What does service docker status say after a reboot? I am quite sure the should be a hint why things are not working as expected.
For instance, if you use a container based volume plugin, it is common that docker “hangs” until the volume plugin is lazy loaded on first usage (like your docker ps -a command).