I am trying to get docker running on Jenkins which itself is a container. Below is part of the Pod spec.
cyrilpanicker/jenkins
is an image with Jenkins and docker-cli installed.
For Docker daemon, I am running another container with docker:dind
image (The nodes are running on a k8s cluster).
And to get docker.sock
linked between them, I am using volume mounts.
spec:
containers:
- name: jenkins
image: cyrilpanicker/jenkins
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-socket
- name: docker
image: docker:dind
securityContext:
privileged: true
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-socket
volumes:
- name: docker-socket
hostPath:
path: /docker.sock
type: FileOrCreate
But this is not working. Below are the logs from the docker
container.
time="2021-06-04T20:47:26.059792967Z" level=info msg="Starting up"
time="2021-06-04T20:47:26.061956820Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
failed to load listeners: can't create unix socket /var/run/docker.sock: device or resource busy
Can anyone suggest another way to get this working?