• Docker遇到的异常和注意点


    Docker遇到的异常和注意点#

    整理一些使用docker的时候,遇到的问题和解决办法

    遇到的一些异常和解决方法#

    删除镜像时出现:#

    Copy
    Error response from daemon: conflict: unable to delete 95219df55354 (must be forced) - image is referenced in multiple repositories
    
    可以通过 docker rmi 名称:tag 来删除,不用id删除
    

    查询docker daemon启动日志#

    Copy
    tail -f /var/log/upstart/docker.log
    
    can't create unix socket /var/run/docker.sock: is a directory
    
    rm -rf  /var/run/docker.sock 然后重新启动
    

    没有权限访问docker.sock#

    Copy
    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
    
    查看 ls -l /var/run/docker.sock,所在的组,(一般在docker组中)
    
    将用户重新加入docker组中,并且重新登录即可(usermod -aG docker ${USER})
    

    状态为dead的容器删除报错#

    Copy
    Error response from daemon: Driver aufs failed to remove root filesystem 0753373785c32e6dabd87396a63844711f4eab04841a0c3183b881d6d939c003: aufs: unmount error after retries: /var/lib/docker/aufs/mnt/aa87e99f1031d48daa66ce1abfb1550248918e4a4bfd737310913e903e4a3f83: device or resource busy
    
    使用docker rm -fv 容器id 过几分钟后会自动删除
    

    防火墙异常#

    Copy
    docker: Error response from daemon: driver failed programming external connectivity on endpoint quizzical_bell (f09acf9ddddc99be6397c5031f5c680088aedd6fe9593d86c4a38c21fdf29d4d):  (iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o docker0 -p tcp -d 172.17.0.2 --dport 8080 -j ACCEPT: iptables: No chain/target/match by that name.
    
    关闭防火墙,重启docker daemo
    sudo service docker restart
    

    端口冲突异常#

    Copy
    docker: Error response from daemon: driver failed programming external connectivity on endpoint kind_turing3 (78479c5356c5cd6aa003b1b97816610ab1c716288faddb48827ee1fdc7a87492): Bind for 0.0.0.0:80 failed: port is already allocated
    
    容器端口冲突,更换宿主机绑定端口
    

    修改完docker root dir,重启后,下载镜像报错:#

    Copy
    docker: Error response from daemon: containerd: container did not start before the specified timeout.ERRO[0133] error getting events from daemon: context canceled 
    
    解决:重启服务器
    作者:Aleen Pan
    出处:http://panxiangfu.cnblogs.com/
    如果您觉得本文对您的学习有所帮助,可通过“微信”或“支付宝”打赏博主,或者点击页面右下角【好文要顶】支持博主。
  • 相关阅读:
    正则表达式30分钟入门教程
    21 个HTML网页转RSS Feeds的工具
    批量去除PHP文件中bom的PHP代码
    WEB网页采集技术参考
    xcache
    Sonix SN9P701 OCR点读笔二维码识别源码
    UI设计素材资源网站推荐
    解决电信DNS劫持
    自学电子技术的最佳方法
    wp资源汇总
  • 原文地址:https://www.cnblogs.com/panxiangfu/p/12723412.html
Copyright © 2020-2023  润新知