Stopping Docker containers by image name - Ubuntu

后端 未结 16 1417
故里飘歌
故里飘歌 2020-12-12 10:04

On Ubuntu 14.04 (Trusty Tahr) I\'m looking for a way to stop a running container and the only information I have is the image name that was used in the Docker run comma

16条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 10:53

    Two ways to stop running a container:

    1. $docker stop container_ID
    
    2. $docker kill container_ID
    

    You can get running containers using the following command:

    $docker ps
    

    Following links for more information:

    • https://docs.docker.com/engine/reference/commandline/stop/
    • https://docs.docker.com/v1.8/reference/commandline/kill/

提交回复
热议问题