docker - how do you disable auto-restart on a container?

后端 未结 4 1182
梦如初夏
梦如初夏 2020-11-29 15:58

I can enable auto-restart with --restart=always, but after I stop the container, how do I turn off that attribute?

I normally run a webserver and typica

4条回答
  •  無奈伤痛
    2020-11-29 16:14

    If you have a swarm restarting the containers, the swarm will restart any containers you stop or rm, irrespective of the restart option. That's a feature, not a bug.

    Make sure you are not running a service you forgot about:

    docker service ls
    

    Then, you can stop the service

    docker service rm 
    

提交回复
热议问题