Languages
[Edit]
EN

Docker - kill container

1 points
Created by:
Root-ssh
116170

In this short article we would like to show how to kill docker container.

Quick solution (run following command):

docker kill put_container_id_here

Detailed steps example

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:

  1. find container id listing all containers with following command:
    docker ps
    Output:
    CONTAINER ID     IMAGE                                                           COMMAND                   CREATED             STATUS                     PORTS                                      NAMES
    4f2135f4f315     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
    f43154f5213f     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 .

  2. kill container with following command:
    docker kill 4f2135f4f315

Docker - useful wiki posts

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join