Docker service start after server restart

Viewed 8449

I'm struggling with dockers (17) on Ubuntu(14). I have to run rabbitMQ on a couple of machines using docker technology. I managed to do that on one of them using

sudo docker service create -d --hostname my-rabbit --name some-rabbit -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password rabbitmq:3-management

but i encounter a problem on others. When i run Rabbit as a docker service everything is OK, but the problem starts after restarting the machine. After server reboot the docker is started automaticaly- i run

sudo docker service list
sudo docker ps

to check that. But when I want to connect to the rabbitServer using the browser nothing happens. When i use curl or wget inside the servier it waits for the response and nothing happens. when i run

sudo service docker restart

then everything starts to work like it should. the ports are open all the time, and the info is saved so after restart i dont have to reopen them. One of the machines does not have this problem and everything works even after restart

2 Answers

It's weird and i still don't know why this works. After I rebooted the machine, then I restarted docker service as well and after that i saved again the ipconfig persistent configuration without adding anything to the rules- it started working on all of the machines

Related