2020年4月24日 星期五

[Docker] Docker run emits "name is already in use" error

Background
When trying to docker run through docker compose, name is already in use appeared.

Solutions
Using docker ps -a, we will find there are docker containers created with the same name, it may due to docker compose stop not cleanly close all the containers.

To solve, find out, we can try to close all the running containers (you can find which one's name is duplicated, but I want to make life easier), docker stop $(docker ps -a -q), re-run the docker compose script again
References

沒有留言:

張貼留言