From 5c851b455e6578b7dd21eadececeb9e9c15b75d8 Mon Sep 17 00:00:00 2001 From: Claude AI Date: Mon, 5 Jan 2026 17:14:04 +0000 Subject: [PATCH] fix(jenkins): Add Docker CLI via init container and mount docker socket --- apps/jenkins/deployment.yaml | 56 ++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/apps/jenkins/deployment.yaml b/apps/jenkins/deployment.yaml index b6f005c..e7fdffa 100644 --- a/apps/jenkins/deployment.yaml +++ b/apps/jenkins/deployment.yaml @@ -15,25 +15,43 @@ spec: spec: securityContext: fsGroup: 1000 + initContainers: + - name: install-docker-cli + image: docker:24-cli + command: + - sh + - -c + - | + cp /usr/local/bin/docker /tmp/docker-bin/ + chmod +x /tmp/docker-bin/docker + volumeMounts: + - name: docker-cli + mountPath: /tmp/docker-bin containers: - - name: jenkins - image: jenkins/jenkins:lts-jdk17 - ports: - - containerPort: 8080 - - containerPort: 50000 - env: - - name: JENKINS_OPTS - value: "--httpPort=8080" - volumeMounts: - - name: jenkins-home - mountPath: /var/jenkins_home - - name: docker-sock - mountPath: /var/run/docker.sock - volumes: + - name: jenkins + image: jenkins/jenkins:lts-jdk17 + ports: + - containerPort: 8080 + - containerPort: 50000 + env: + - name: JENKINS_OPTS + value: "--httpPort=8080" + - name: PATH + value: "/tmp/docker-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + volumeMounts: - name: jenkins-home - persistentVolumeClaim: - claimName: jenkins-home + mountPath: /var/jenkins_home - name: docker-sock - hostPath: - path: /var/run/docker.sock - type: Socket + mountPath: /var/run/docker.sock + - name: docker-cli + mountPath: /tmp/docker-bin + volumes: + - name: jenkins-home + persistentVolumeClaim: + claimName: jenkins-home + - name: docker-sock + hostPath: + path: /var/run/docker.sock + type: Socket + - name: docker-cli + emptyDir: {}