jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-75610] docker-workflow doesn't set DOCKER_HOST

Open
#730 0 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

Given a pipeline with a custom `DOCKER_HOST`:

 

node {

    stage('Testing LIMA VM') {
        docker.withServer('unix:///home/user/.lima/lima-test/sock/docker.sock') {
            docker.image('jenkins/agent').inside {
                sshagent(['user_b']) {
                    sh 'ssh-add -l'
                }
            }
        }
    }
}

I get this error: 

ERROR: Failed to run ssh-agent: Error response from daemon: No such container: 85b4f32a54d1292....

 

I've investigated the issue and I think that https://github.com/jenkinsci/docker-workflow-plugin/blob/19b84d6e042ec18c159487b59e21f9644eb14e5b/src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java#L263 should inject `DOCKER_HOST` into the `starter` envs (using the value from `envHost`)

 

 

---
Originally reported by jmdesprez, imported from: docker-workflow doesn't set DOCKER_HOST


  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

Given a pipeline with a custom `DOCKER_HOST`:

 



node {

    stage('Testing LIMA VM') {
        docker.withServer('unix:///home/user/.lima/lima-test/sock/docker.sock') {
            docker.image('jenkins/agent').inside {
                sshagent(['user_b']) {
                    sh 'ssh-add -l'
                }
            }
        }
    }
}


I get this error: 
ERROR: Failed to run ssh-agent: Error response from daemon: No such container: 85b4f32a54d1292....
 

I've investigated the issue and I think that https://github.com/jenkinsci/docker-workflow-plugin/blob/19b84d6e042ec18c159487b59e21f9644eb14e5b/src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java#L263 should inject `DOCKER_HOST` into the `starter` envs (using the value from `envHost`)

 

 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.