Docker - kill container

1 points
Created by:

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
    CONTAINER ID     IMAGE                                                           COMMAND                   CREATED             STATUS                     PORTS                                      NAMES
    4f2135f4f315     "/docker-entrypoint.…"    22 minutes ago      Up 22 minutes (healthy)    80/tcp, 443/tcp,>8080/tcp    deploy_backend
    f43154f5213f    "/docker-entrypoint.…"    21 minutes ago      Up 21 minutes (healthy)    81/tcp, 443/tcp,>8081/tcp    deploy_frontend

    We want to stop container with id equal to 4f2135f4f315 .

  2. kill container with following command:
    docker kill 4f2135f4f315
Hey 👋
Would you like to know what we do?
  • Dirask is online IT community for professionals and hobbyist to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.