How can I stop and delete a docker container launched with restart always option?

前端 未结 3 1427
时光取名叫无心
时光取名叫无心 2021-02-13 07:06

I run some containers with the option --restart always.

It works good, so good, that I have now difficulties to stop these containers now :)

I tried :

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-13 08:01

    Just

    sudo docker rm -f container
    

    will kill the process if it is running and remove the container, in one step.

    That said, I couldn't replicate the symptoms you described. If I run with --restart=always, docker stop will stop the process and it remains stopped.

    I am using Docker version 1.3.1.

提交回复
热议问题