Cannot stop or restart a docker container

前端 未结 10 1081
别跟我提以往
别跟我提以往 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:46

    That looks like docker/docker/issues/12738, seen with docker 1.6 or 1.7:

    Some container fail to stop properly, and the restart

    We are seeing this issue a lot in our users hosts when they upgraded from 1.5.0 to 1.6.0.
    After the upgrade, some containers cannot be stopped (giving 500 Server Error: Internal Server Error ("Cannot stop container xxxxx: [2] Container does not exist: container destroyed")) or forced destroyed (giving 500 Server Error: Internal Server Error ("Could not kill running container, cannot remove - [2] Container does not exist: container destroyed")). The processes are still running on the host.
    Sometimes, it works after restarting the docker daemon.

    There are some workarounds:

    I've tried all remote API calls for that unkillable container and here are results:

    • json, stats, changes, top, logs returned valid responses
    • stop, pause, wait, kill reported 404 (!)

    After I finished with remote API, I double-checked docker ps (the container was still there), but then I retried docker kill and it worked! The container got killed and I could remove it.

    Or:

    What worked was to restart boot2docker on my host. Then docker rm -f

    $ boot2docker stop
    $ boot2docker start
    $ docker rm -f 1f061139ba04
    

提交回复
热议问题