community.docker icon indicating copy to clipboard operation
community.docker copied to clipboard

Ability to docker-compose "--no-start"

Open ntdaley opened this issue 2 years ago • 0 comments

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 and build: 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 to docker-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

ntdaley avatar Aug 02 '21 19:08 ntdaley