How can u restart the containers present in docker after a power outage.
After the power outage the containers are not running. When i check docker with:
pi@BrewPi-server:~ $ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2d2d8251e5e9 brewpi/brewpi-raspbian “/entrypoint.sh /wat…” 4 days ago Exited (255) 24 hours ago 0.0.0.0:80-81->80-81/tcp brewpi
a6f19a40f20b portainer/portainer “/portainer -H unix:…” 5 days ago Exited (255) 24 hours ago 0.0.0.0:9000->9000/tcp portainer
I can see they have the status Exited. When I try to start these containers i get the response:
pi@BrewPi-server:~ $ docker start portainer
Error response from daemon: container “a6f19a40f20b6ef7faeb6291f4b9524bba4e5c3f216bda30e48e74b40379d6b6”: already exists
Error: failed to start containers: portainer
What can I do to start these containers. And what to do to restart them automatically after a power outage.
Creating them with --restart always should handle that for you.
This is part of the commands given on the wiki.
Maybe the containers are somehow broken due to the outage? couldn’t find much about exit code 255 that seemed relevant. If you run docker stop, docker rm, then recreate the containers you should still have all your settings and data.
Have it happen every reboot/shut-down. Possibly a docker bug.
Kill, restart, pause etc does not work. Just rm and recreate.
From wiki. What, if any, brew/controller settings are not stored outside the container?
I plan to just add simple start script to rm/run brewpi/portainer containers every time os comes up. Sucky work around but will do the job.
Once up and completed full hardware environment will be no concern as whole fridge. controllers, routers all on UPS.
If you do this, you will lose any changes you made inside the container. Only the BrewPi settings and data that are stored outside of the container are kept.
Just following up. Problem sorted. Docker bug, fixed in latest docker 18.05.
Also installed and configured docker-compose for portainer only, will think about adding brewpi.