Stopping Docker containers by image name - Ubuntu

后端 未结 16 1431
故里飘歌
故里飘歌 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条回答
  •  萌比男神i
    2020-12-12 10:56

    You could start the container setting a container name:

    docker run -d --name  
    

    The same image could be used to spin up multiple containers, so this is a good way to start a container. Then you could use this container-name to stop, attach... the container:

    docker exec -it  bash
    docker stop 
    docker rm 
    

提交回复
热议问题