Is it possible just to start a single container among a group of stopped Docker Compose container?
I have a docker-compose.yml
file that contains 4 containers: redis
, postgres
, api
and worker
. If all of them has stopped, can I start just one of them to check the config files within it? I’m getting
you cannot start and attach multiple containers at once
and I’m wondering if there is any way to work around it.
2
Answers
It’s hard to exactly answer your question without an mvp compose file that gets the error you want. But you don’t need to start the container to look at a config file in it.
Look at the docker mount, unmount, cp, and export commands.
You can run a single container with command
If you want to check the config files within it, you could just run
Another way to do it is by copying the config file directly without running the stopped container with this command