While trying to build docker image to my application, somehow I accidentally create 2 containers with status Created
.
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
597a3d226a08 2eba970a4fc8 "entrypoint.sh" 43 hours ago Created pedantic_almeida
bae7a9324bc8 b0898d035451 "entrypoint.sh" 43 hours ago Created zen_franklin
The problem is I cannot do anything with these containers. docker rm/restart/inspect <container-id>
all hangs up indefinitely with no message printed. However, starting new container from these 2 images work fine.
So my question is how to remove these 2 containers? Please tell me if you need any additional information.
Docker version: 18.03.0-ce
.
docker kill
you can get more info runningdocker kill --help
. Once you kill the containers and bring them into "exited" state, you'll be able to remove them. – GeistCannot kill container: bae7a9324bc8: Container ... is not running
. – Zugdocker container prune --force
. This will remove all stopped containers, so be careful. – Geistdocker system prune
before but it did not work. Not sure what are the differences between 2 commands. Btw, you can write an answer so I can accept it. – Zug