use tcp DOCKER_HOST instead of sharing docker.sock
This commit is contained in:
parent
e613219a89
commit
83857ba7e0
|
|
@ -381,23 +381,17 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
|
||||||
EmptyDir: &corev1.EmptyDirVolumeSource{},
|
EmptyDir: &corev1.EmptyDirVolumeSource{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "docker",
|
|
||||||
VolumeSource: corev1.VolumeSource{
|
|
||||||
EmptyDir: &corev1.EmptyDirVolumeSource{},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
pod.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{
|
pod.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{
|
||||||
{
|
{
|
||||||
Name: "work",
|
Name: "work",
|
||||||
MountPath: "/runner/_work",
|
MountPath: "/runner/_work",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "docker",
|
|
||||||
MountPath: "/var/run",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
pod.Spec.Containers[0].Env = append(pod.Spec.Containers[0].Env, corev1.EnvVar{
|
||||||
|
Name: "DOCKER_HOST",
|
||||||
|
Value: "tcp://localhost:2375",
|
||||||
|
})
|
||||||
pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{
|
pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{
|
||||||
Name: "docker",
|
Name: "docker",
|
||||||
Image: r.DockerImage,
|
Image: r.DockerImage,
|
||||||
|
|
@ -406,9 +400,11 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
|
||||||
Name: "work",
|
Name: "work",
|
||||||
MountPath: "/runner/_work",
|
MountPath: "/runner/_work",
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
Env: []corev1.EnvVar {
|
||||||
{
|
{
|
||||||
Name: "docker",
|
Name: "DOCKER_TLS_CERTDIR",
|
||||||
MountPath: "/var/run",
|
Value: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
SecurityContext: &corev1.SecurityContext{
|
SecurityContext: &corev1.SecurityContext{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue