Another solution that does not impact your pipelines, is to use a DinD 
container and export DOCKER_HOST in all the containers of the pod, this 
allows access to Docker to all containers using the docker CLI

pipeline {
  agent {
  kubernetes {
    defaultContainer 'docker-cli'
    yaml '''
      apiVersion: v1
      kind: Pod
      spec:
        imagePullSecrets:
          - name: 'repo.example.com'
          - name: 'repo1.example.com'
        containers:
          - name: dind
            image: docker:20.10.12-dind
            securityContext:
              privileged: true
            env:
              - name: DOCKER_TLS_CERTDIR
                value: ""
            command:
              - dockerd
            args:
              - -H tcp://localhost:2375
              --H unix:///var/run/docker.sock
            ports:            
              - containerPort: 2375
                hostIP: 127.0.0.1
            volumeMounts:
              - name: docker-cache
                mountPath: /var/lib/docker
          - name: docker-cli
            image: my-docker-cli-container:latest
            command:
              - sleep
            args:
              - infinity
            env:
              - name: DOCKER_HOST
                value: tcp://localhost:2375
            volumes:
              - name: docker-cache
                emptyDir: {}
'''
}
}
....

El miércoles, 13 de abril de 2022 a las 1:21:17 UTC+2, [email protected] 
escribió:

> For builds that need docker, we have used docker:dind in the past. So we 
> have a maven build running in a maven container in a pod, and that build 
> uses dind to run testcontainers. 
>
> I wonder if something like that would work for your use case?
>
> Here’s more info on dind: 
>
> http://blog.teracy.com/2017/09/11/how-to-use-docker-in-docker-dind-and-docker-outside-of-docker-dood-for-local-ci-testing/
>
> On Wed, Sep 29, 2021 at 19:05 'Mario Rodriguez' via Jenkins Users <
> [email protected]> wrote:
>
>> Hello, Kubernetes project is planning to deprecate support for dockershim 
>> runtime is version 1.20 and fully drop it in version 1.24 as indicated 
>> here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>>
>>  
>>
>> Reading about the impacts of dockershim removal here:  
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>>   and 
>> here 
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>>  ,  any 
>> apps that depend on the docker daemon by exposing /var/run/docker.sock will 
>> be impacted.  We use the Kubernetes plugin for Jenkins 
>> <https://plugins.jenkins.io/kubernetes/> using this docker daemon 
>> exposure technique.
>>
>>
>> Assuming a transition from docker to containerd, any idea what changes 
>> will be needed by Kubernetes plugin users to continue working properly ?
>>
>>
>> thanks
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0d79c6f8-a868-41d7-854f-0350edf67db8n%40googlegroups.com.

Reply via email to