jenkins-docker icon indicating copy to clipboard operation
jenkins-docker copied to clipboard

hope to update documents

Open feg545 opened this issue 5 years ago • 4 comments

Dear author, seems like this is the most popular Jenkins image with docker in docker, thank you very much! I found some issues when trailing your image, hope you can consider them:

  1. will meet the 'Permission Denied' issue. since the /var/run/docker.sock in the host, is only allows root user/docker group to access, but this image will use Jenkins user in the container, so I would like to run with --user 0 to simply avoid this issue, any better idea?

  2. suggest adding volume: /etc/docker. then we can use the same certs.d fold and daemon.json as the host machine. although we can manually mount any path into a Docker container, this is still a hint for some docker management UI to create a volume (like Portainer).

  3. It would be nice to give a Jenkins Pipeline example to build a docker image.

feg545 avatar Dec 16 '19 09:12 feg545

Thanks for the feedback. To your points:

  1. I didn't get that error myself. Running as root all the time isn't the ideal option though, in my opinion. One approach would be to specify the user as arguments - that might add some flexibility?
  2. That looks like a good idea, I'll have a look in to that. You are welcome to submit a pull request if you'd like to be a contributor.
  3. Yes - that is on my list of things to write. Hopefully over the holiday season I will find a day or so to put that together.

4OH4 avatar Dec 23 '19 11:12 4OH4

I think the first issue here is solved by PR #3. Then you can run with user jenkings and nevertheless access docker from the host. @4OH4 what do you think?

christianlupus avatar Feb 07 '20 10:02 christianlupus

Sorry for dragging my feet a bit on PR #3 - other commitments keeping me away and have been trying to garner some opinons on good practice here.

I'm conscious of adding layers of complexity to patch an issue with the underlying method. That said, the entrypoint script method seems quite neat. Do you see any potential downsides?

4OH4 avatar Feb 12 '20 13:02 4OH4

I will shift the discussion into the PR as I do not want to hiccup this issue right now.

christianlupus avatar Feb 13 '20 14:02 christianlupus