I have a solution with docker compose support added. After I add the support in the run dropdown I have the option to run project with docker compose.
Docker compose appears as a node in the solution tree.
However, if I clone code from repo the docker-compose node is there but it is not an option under the run menu. Also this happens sometimes randomly where I open existing proect and the option to run with docker compose has gone but the node is still there. It also happens when switching branches.
To fix this I have to delete the docker-compose node and then re-add support and select option to not overwrite files. Then the option appears again.
Why is this happening? Why does docker compose node in solution explorer show but the run option isn't there? In both situation the dockerfile run option is there but not the compose option.
The key difference between docker run versus docker-compose is that docker run is entirely command line based, while docker-compose reads configuration data from a YAML file. The second major difference is that docker run can only start one container at a time, while docker-compose will configure and run multiple.
Run Docker Compose in detached mode by passing the -d flag to docker-compose up . Use docker-compose ps to review what you have running.
To start (up), stop, restart or build a single service (container) using the Docker Compose, simply specify the name of the service against which to run the corresponding docker-compose command.
Right click 'docker-compose' in solution explorer and 'set as startup project'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With