• dockercompose up 时 Permission denied


    docker-compose up 时 Permission denied

    File "docker/transport/unixconn.py", line 43, in connect
    PermissionError: [Errno 13] Permission denied
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "requests/adapters.py", line 449, in send
      File "urllib3/connectionpool.py", line 727, in urlopen
      File "urllib3/util/retry.py", line 410, in increment
      File "urllib3/packages/six.py", line 734, in reraise
      File "urllib3/connectionpool.py", line 677, in urlopen
      File "urllib3/connectionpool.py", line 392, in _make_request
      File "http/client.py", line 1277, in request
      File "http/client.py", line 1323, in _send_request
      File "http/client.py", line 1272, in endheaders
      File "http/client.py", line 1032, in _send_output
      File "http/client.py", line 972, in send
      File "docker/transport/unixconn.py", line 43, in connect
    urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "docker/api/client.py", line 214, in _retrieve_server_version
      File "docker/api/daemon.py", line 181, in version
      File "docker/utils/decorators.py", line 46, in inner
      File "docker/api/client.py", line 237, in _get
      File "requests/sessions.py", line 543, in get
      File "requests/sessions.py", line 530, in request
      File "requests/sessions.py", line 643, in send
      File "requests/adapters.py", line 498, in send
    requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "docker-compose", line 3, in <module>
      File "compose/cli/main.py", line 81, in main
      File "compose/cli/main.py", line 200, in perform_command
      File "compose/cli/command.py", line 70, in project_from_options
      File "compose/cli/command.py", line 153, in get_project
      File "compose/cli/docker_client.py", line 43, in get_client
      File "compose/cli/docker_client.py", line 170, in docker_client
      File "docker/api/client.py", line 197, in __init__
      File "docker/api/client.py", line 222, in _retrieve_server_version
    docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))
    [240105] Failed to execute script docker-compose
    

    凭直觉给 docker-compose 777的权限,发现不可以。

    再仔细观察异常栈后,我猜测是关于网络连接相关的文件缺少权限,so给docker-compose加权限就没用了。

    搜索后发现解决方案:https://qastack.cn/programming/48957195/how-to-fix-docker-got-permission-denied-issue

    sudo chmod 777 /var/run/docker.sock
    

    套接字没有权限。

  • 相关阅读:
    扩展GridView控件增加选择列
    Flash图片轮换/切换左右推拉效果
    Flash图片轮换/切换普通效果1
    WebForm_PostBackOptions未定义 解决方法
    SQL Server 2008无法还原日志备份或差异备份的问题解决(转)
    一个简单的C#多线程间同步的例子.[转]
    SQL2008报错:无法还原日志备份或差异备份,因为没有文件可用于前滚(转)
    C# 字符、字符串过滤,只能输入数字、中文、英文、大写、小写(转)
    C# Monitor类锁定对象
    使用SqlServer中的float类型时发现的问题(转)
  • 原文地址:https://www.cnblogs.com/woooodlin/p/15830259.html
Copyright © 2020-2023  润新知