[RUBY] docker-compose up How to stop and restart Docker when a run-time error occurs [Cannot start service database: driver failed programming external connectivity on endpoint]

[How to stop and restart Docker]

docker-compose up

Cannot start service database: driver failed programming external connectivity on endpoint 

This is a method to check and stop Docker that is currently running, which can be used when an error occurs.

① Check the current status of Docker

docker ps

To check the currently running Docker.

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                               NAMES
4db7e2473829        mysql:latest        "docker-entrypoint.s…"   8 days ago          Up 8 days           0.0.0.0:3306->3306/tcp, 33060/tcp   hello_world_database_1

It will be displayed like this. (It's hard to see, so it's better to widen the window to fill the screen.)

Confirm CONTAINER ID and copy (In the above, copy 4db7e2473829.)

② Stop Docker

docker stop 'CONTAINER ID'

To execute. 'CONTAINER ID' will be the value you copied earlier.

This time

docker stop 4db7e2473829

It will be.

③ Check Docker again (whether the specified Docker can be stopped)

again

docker ps

To execute.


CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

When all Docker is stopped, the above display (no value is entered) is displayed. If there is a Doker running other than the Docker stopped in (2), the value other than the stopped Docker will be displayed.

④ Start Docker

Once the above work is done, as usual

docker-compose up

Let's run. You should be able to run it without errors.

Recommended Posts

docker-compose up How to stop and restart Docker when a run-time error occurs [Cannot start service database: driver failed programming external connectivity on endpoint]
Note: [Docker] How to start and stop
[Docker] How to update using a container on Heroku and how to deal with Migrate Error
The story when the container does not start up with docker-compose up and an error occurs
What to do if you get a port error when docker-compose up on Mac
When starting Eclipse debug, I get a `ERROR: JDWP Transport dt_socket failed` error and cannot start.
[Docker] How to back up and restore the DB data of Rails application on docker-compose [MySQL]