I’m trying to run postgres
docker:
docker run --name some-postgres -e POSTGRES_PASSWORD=123456 -d postgres
I’m getting error message:
docker: Error response from daemon: Conflict. The container name "/some-postgres" is already in use by container "93b72872c89cf7497872b0bc0e98d5a91078666945e3ca39ce5cbb36c436b5af". You have to remove (or rename) that container to be able to reuse that name.
I checked with:
sudo docker ps
And there is nothing:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
(Empty)
- so, why I’m getting this error message ?
- If the container name already exsits, How can I run it ?
2
Answers
Try running
docker ps -a
you will see existing container name and remove that usingdocker rm some-postgres
. and run the docker run command again.Check this (shows all containers, includes stopped)
And then delete container