EN
Docker - kill container
1 points
In this short article we would like to show how to kill docker container.
Quick solution (run following command):
xxxxxxxxxx
1
docker kill put_container_id_here
It is important to know container id to stop proper container. This section shows how to find that id and use it to kill container.
Simple steps:
- find container id listing all containers with following command:
Output:
xxxxxxxxxx
1docker ps
xxxxxxxxxx
1CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
24f2135f4f315 408729922323.dkr.ecr.eu-west-1.amazonaws.com/backend:master "/docker-entrypoint.…" 22 minutes ago Up 22 minutes (healthy) 80/tcp, 443/tcp, 0.0.0.0:8080->8080/tcp deploy_backend
3f43154f5213f 987224932320.dkr.ecr.eu-west-1.amazonaws.com/frontend:master "/docker-entrypoint.…" 21 minutes ago Up 21 minutes (healthy) 81/tcp, 443/tcp, 0.0.0.0:8081->8081/tcp deploy_frontend
We want to stop container with id equal to
4f2135f4f315
. - kill container with following command:
xxxxxxxxxx
1docker kill 4f2135f4f315