community.docker
community.docker copied to clipboard
Ability to docker-compose "--no-start"
SUMMARY
I want to be able to create the docker containers listed in my docker-compose.yml, without actually starting them. (This server acts as a backup, and the containers will only be started if the main server fails.)
ISSUE TYPE
- Feature Idea
COMPONENT NAME
docker_compose
ADDITIONAL INFORMATION
I have a server that will have a backup copy of production data and containers. The containers will only be enabled if the production server(s) fail.
Because I did not want the container to be started, I configured docker_compose
with stopped: yes
.
But, this also stopped the container from being built. Even if I supplied the setting build: yes
.
Either:
- If,
stopped: yes
andbuild: yes
are configured, then the build should still happen. - If, a new
nostart: yes
setting is configured, then the--no-start
parameter should be passed todocker-compose up
This is a snippet from the configuration I was trying that didn't work.
docker_compose:
project_src: /data/docker-config/
state: present
recreate: smart
build: yes
stopped: yes