Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61498

Docker inside Docker not detected correctly with Windows Containers

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The logic in https://github.com/jenkinsci/docker-workflow-plugin/blob/5191865cd0126b3d25ef11fd03bf932c4178ea91/src/main/java/org/jenkinsci/plugins/docker/workflow/client/DockerClient.java#L337 currently does not handle windows containers properly.

      The result of this is that the magic volumes from container logic https://github.com/jenkinsci/docker-workflow-plugin/blob/1089131014350e11adfa364d34e7717954350261/src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java#L181 is not being invoked in cases where it's needed.

      In my situation I've worked around the issue by exposing making workspace root a bind mount to the same path on the host, but it would be nice if this "just works".

      At least when using the Docker Agent plugin (https://plugins.jenkins.io/docker-plugin/) it looks like the container ID is available inside the job as an environment variable DOCKER_CONTAINER_ID. I imagine this is a special case from the docker-plugin setting this up though. I'm not sure what the correct general way to determine the container id with Windows Containers, but leveraging DOCKER_CONTAINER_ID where available would be better than nothing.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nvx Tiernan Messmer
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: