Docker commands do not respond anymore

后端 未结 4 621
青春惊慌失措
青春惊慌失措 2021-02-13 01:45

Most of docker commands never end. I have to interrupt them manually with CTRL+C. Even simple commands like docker ps or docker info do not respond.

相关标签:
4条回答
  • 2021-02-13 02:31

    I just had a similar issue as well. Rebooting the server did not work for me. I got this issue, because I just installed a new container with some kind of errors. After that, most Docker commands did not respond. I fixed it by executing the following command:

    docker system prune -a
    

    This removes all unused containers. In my case also the container I just added. More information:

    https://docs.docker.com/engine/reference/commandline/system_prune/

    0 讨论(0)
  • 2021-02-13 02:34

    From the symptoms that you present, it seems something I struggled as well. I did the following, hope it helps!

    After checking it the service was not responding successfully, using:

    system status docker.service
    

    I used the following command to put it to work:

    sudo dockerd --debug
    
    0 讨论(0)
  • 2021-02-13 02:37

    I had the same problem (commands not responding) and I fix it by increasing the resources allocated to Docker.

    Docker Desktop -> Preferences -> Advanced

    In my case, I increased:

    • Memory from 2GB to 8GB
    • Swap from 1GB to 2GB

    Try different values according with your machine.

    0 讨论(0)
  • 2021-02-13 02:43

    That Docker commands hanging bug happened after I deleted a container.

    The daemon dockerd was in an abnormal state: it couldn't be started (sudo service docker start) after having been stopped (service docker stop).

    # sudo service docker start
    Redirecting to /bin/systemctl start docker.service
    Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
    
    # journalctl -xe
    kernel: device-mapper: ioctl: unable to remove open device docker-253:0-19468577-d6f74dd67f106d6bfa483df4ee534dd9545dc8ca
    ...
    systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    systemd[1]: Failed to start Docker Application Container Engine.
    systemd[1]: Unit docker.service entered failed state.
    systemd[1]: docker.service failed.
    polkitd[896]: Unregistered Authentication Agent for unix-process:22551:34177094 (system bus name :1.290, object path /org
    ESCESC
    kernel: dev_remove: 41 callbacks suppressed
    kernel: device-mapper: ioctl: unable to remove open device docker-253:0-19468577-fc63401af903e22d05a4518e02504527f0d7883f9d997d7d97fdfe72ba789863
    ...
    dockerd[22566]: time="2016-11-28T10:18:09.840268573+01:00" level=fatal msg="Error starting daemon: timeout"
    systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    systemd[1]: Failed to start Docker Application Container Engine.
    

    Moreover, many zombie Docker processes could be observed using ps -eax | grep docker (presence of a "Z" in the "STAT" column), for example docker-proxies.

    After rebooting the server and restarting Docker, the zombie processes disappeared and Docker commands were working again.

    0 讨论(0)
提交回复
热议问题