0

I'm having an issue where a jenkins agent can't access Docker, and I'm just about ready to give up but I figured I'd try asking here first.

Along with the official documentation, I've also been using this guide to help me setup using docker compose, and also with an agent.

The agent is however unable to access docker. Actually it also didn't have git installed, so I had to install that. Actually apt was broken in the image so I had to fix that after installing it and install again. I extended the image as follows because this was getting painful:

FROM jenkins/ssh-agent:jdk11
RUN apt update
RUN sh -c 'apt install -y git-all || true'
RUN mv /var/lib/dpkg/info/install-info.postinst /var/lib/dpkg/info/install-info.postinst.bad
RUN apt install -y git-all

The jenkins/ssh-agent:jdk11 image is the official image from Jenkins for an agent node, which surprised me when I double-checked that.

I tried adding these volumes to it in the docker-compose file:

  volumes
    - /var/run/docker.sock:/var/run/docker.sock
    - /usr/bin/docker:/usr/bin/docker

and that didn't work. I tried adding a jenkins user on my host so I could sudo usermod -a -G docker jenkins (in case that's where the check would happen).

3
  • 2
    I have a feeling a question like this would get more traction in either the ServerFault or DevOps sites. Not saying it's inappropriate to put it here, I'm just thinking about how you'll get the fastest and most focused answers. Commented Jan 16, 2023 at 4:48
  • 1
    thanks, I think you're correct. Also I appreciate how uncharacteristically kindly-worded that was for a StackExchange comment :) Commented Jan 16, 2023 at 5:13
  • I'm subscribed to the Jenkins tags on all SE sites. My experience is that Jenkins questions get the most attention on StackOverflow, followed by DevOps. I would not suggest posting to ServerFault. Commented Jan 17, 2023 at 16:48

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.