Stopping Docker containers by image name - Ubuntu

后端 未结 16 1460
故里飘歌
故里飘歌 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:54

    I was trying to wrap my Docker commands in gulp tasks and realised that you can do the following:

    docker stop container-name
    docker rm container-name
    

    This might not work for scenarios where you have multiple containers with the same name (if that's possible), but for my use case it was perfect.

提交回复
热议问题