0

I deployed version 2.319.3 of Jenkins helm but I have an issue stranger with the container docker. My version Kubernetes: 1.22.6 (aks).

ERROR:

docker build -t registry.azurecr.io/test:develop-v81. Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Test another docker command:

  • docker info Client: Context: default Debug Mode: false

Server: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? errors pretty printing info

My agents pods config:

apiVersion: "v1" kind: "Pod" metadata: labels: jenkins/jenkins-jenkins-agent: "true" jenkins/label-digest: "500b4f18aee87616849e4f4c2435020898e34aa0" jenkins/label: "jenkins-jenkins-agent" name: "default-gvzg5" spec: containers:

  • args:
    • "********"
    • "default-gvzg5" env:
    • name: "JENKINS_SECRET" value: "********"
    • name: "JENKINS_TUNNEL" value: "jenkins-agent.whitelabel.svc.cluster.local:50000"
    • name: "JENKINS_AGENT_NAME" value: "default-gvzg5"
    • name: "JENKINS_NAME" value: "default-gvzg5"
    • name: "JENKINS_AGENT_WORKDIR" value: "/home/jenkins/agent"
    • name: "JENKINS_URL" value: "http://jenkins.whitelabel.svc.cluster.local:8080/jenkins" image: "jenkins/inbound-agent:4.11.2-4" imagePullPolicy: "IfNotPresent" name: "jnlp" resources: limits: {} requests: {} tty: true volumeMounts:
    • mountPath: "/var/run/docker.sock" name: "volume-0" readOnly: false
    • mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent"
  • args:
    • "9999999" command:
    • "sleep" image: "docker:20.10" imagePullPolicy: "IfNotPresent" name: "docker2" resources: limits: {} requests: {} securityContext: privileged: true tty: true volumeMounts:
    • mountPath: "/var/run/docker.sock" name: "volume-0" readOnly: false
    • mountPath: "/home/jenkins/agent" name: "workspace-volume" readOnly: false workingDir: "/home/jenkins/agent" hostNetwork: false nodeSelector: kubernetes.io/os: "linux" restartPolicy: "Never" serviceAccountName: "default" volumes:
  • hostPath: path: "/var/run/docker.sock" name: "volume-0"
  • emptyDir: medium: "" name: "workspace-volume"

The docker container should be working. This is working with the old version of jenkins 2.277.1.

1 Answer 1

0

The problem is caused for the Kubernetes version. You can't execute Daemon docker /var/run/docker.sock with privileges. You can try to fix this with Kaniko Container or use a Virtual Machine with docker and privileges. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.