Cannot stop or restart a docker container

前端 未结 10 1167
别跟我提以往
别跟我提以往 2021-01-30 01:54

When trying to stop or restart a docker container I\'m getting the following error message:

$ docker restart 5ba0a86f36ea
Error response from daemon: Cannot rest         


        
10条回答
  •  灰色年华
    2021-01-30 02:38

    All the docker: start | restart | stop | rm --force | kill commands may not work if the container is stuck. You can always restart the docker daemon. However, if you have other containers running, that may not be the option. What you can do is:

    ps aux | grep <> | awk '{print $1 $2}'
    

    The output contains:

    <><>
    

    Then kill the process associated with the container like so:

    sudo kill -9 <>
    

    That will kill the container and you can start a new container with the right image.

提交回复
热议问题