Containers with the
restart: always policy should be started after the engine startup.
Some containers are, some others aren’t.
Containers that aren’t started all have one thing in common: they possess at least one link to another container.
- Docker for Windows version
1.12.0/ on Windows 10 Pro
- Containers all created with compose
- Example of docker-compose.yml file at the end of this topic: the
mariadbcontainer starts while fine the other (which is linked to the
mariadbcontainer) don’t start automatically
- Containers can all be started fine with
docker-compose up -d
- On Debian the containers are restarted as expected upon engine restart
- I did not stop manually the problematic containers (with
docker stop main_pmafor instance). If I start them manually with
docker start, it works, but when I restart the engine after that, they aren’t restarted (it doesn’t solve the issue).
mariadb: container_name: main_mariadb image: mariadb restart: always ports: - ... volumes: - ... phpmyadmin: container_name: main_pma build: builds/pma restart: always ports: - ... volumes: - ... links: - mariadb:db
Edit: I’d like to add that containers that aren’t started don’t show an existed status time equals to the engine startup time. For instance here, I just restarted my engine (12 sec ago), the
main_db has started correctly, but the
main_pma hasn’t, and it seems Docker hasn’t even tried to start it since it has exited 10 minutes ago.
$ docker ps -a
838ecc3d0413 docker_phpmyadmin "/apache.sh" 23 minutes ago Exited (128) 10 minutes ago main_pma ddca1f400065 mariadb "docker-entrypoint.sh" 23 minutes ago Up 12 seconds 127.0.0.1:3306->3306/tcp main_mariadb
Edit: updated to version
1.12.0, I still encounter the same issue