Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on OSx: failed: Permission denied: /var/run/docker.sock #200

Open
yorammi opened this issue Jul 22, 2021 · 1 comment
Open

Error on OSx: failed: Permission denied: /var/run/docker.sock #200

yorammi opened this issue Jul 22, 2021 · 1 comment

Comments

@yorammi
Copy link
Contributor

yorammi commented Jul 22, 2021

In the last versions only (current LTS: 2.289.2-256), I've started to get the following error when a job is trying to start an agent:
java.net.ConnectException: connect(..) failed: Permission denied
Caused: io.netty.channel.AbstractChannel$AnnotatedConnectException: connect(..) failed: Permission denied: /var/run/docker.sock

It didn't fail on this on older versions.
Posts that can help solving this:
https://stackoverflow.com/questions/44999000/permission-denied-error-invoking-docker-on-mac-host-from-inside-docker-ubuntu-co
https://stackoverflow.com/questions/56827949/jenkins-dial-unix-var-run-docker-sock-connect-permission-denied-macos
https://stackoverflow.com/questions/47854463/docker-got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socke

@odavid
Copy link
Owner

odavid commented Jul 28, 2021

Thanks @yorammi. This is a change in Docker For Mac.
It is not something that can be fixed within the image, but externally.

I think the best way to mitigate it, would be to run docker:dind within the docker-compose and change the configuration of the docker plugin to point to the docker within docker...

Something like that (docker-compose):

  docker:
    image: docker:dind
    privileged: true
    volumes:
      - docker-certs:/certs
    environment:
      DOCKER_TLS_CERTDIR: ''


  jenkins:
    image: odavid/my-bloody-jenkins
  ...
    environment:
      DOCKER_HOST: tcp://docker:2375
      DOCKER_TLS_CERTDIR: ''
   

and within the confiugration:

clouds:
  docker-cloud:
    type: docker
    dockerHostUri: 'tcp://docker:2375'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants