docker-compose start "ERROR: No containers to start"
Solution 1:
The issue here is that you haven't actually created the containers. You will have to create these containers before running them. You could use the docker-compose up
instead, that will create the containers and then start them.
Or you could run docker-compose create
to create the containers and then run the docker-compose start
to start them.
Solution 2:
The reason why you saw the error is that docker-compose start
and docker-compose restart
assume that the containers already exist.
If you want to build and start containers, use
docker-compose up
If you only want to build the containers, use
docker-compose up --no-start
Afterwards, docker-compose {start,restart,stop}
should work as expected.
There used to be a docker-compose create
command, but it is now deprecated in favor of docker-compose up --no-start
.