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

Alternative titles

  1. Docker - stop container
  2. Docker - kill image
  3. Docker - stop image
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

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.

❤️💻 🙂