cmmorrow / build-magic

A general purpose build/install/deploy tool.
MIT License
9 stars 2 forks source link

Raise an error when trying to start an already running container #31

Closed cmmorrow closed 3 years ago

cmmorrow commented 3 years ago

Is your feature request related to a problem? Please describe. Currently, if build-magic fails to shutdown a Docker container (named build-magic) properly when using the docker runner, the container will continue to run. If trying to run build-magic again with the docker runner, the setup will fail with a generic "Setup failed" error message.

Describe the solution you'd like Modify the container_up() function to first check to see if a container named build-magic is already running, and give a detailed error message that says "Setup failed because the build-magic Docker container is already running. Please stop and remove the container to fix this error."

Describe alternatives you've considered Alternatively, investigate having build-magic stop and remove the container automatically before trying to start the Docker container. If doing this, print a message to let the user know the build-magic container is already running and is being shutdown before creating a new container.