-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: docker-workflow-plugin
I found a bug that doesn't let me set the company proxy inside a docker container because it is defined on the host as well.
environment variable on the host:
https_proxy=mycompany.de:8080
Â
pipeline {
agent {
label 'master'
}
stages {
stage('Azure Docker Image Build') {
steps {
withDockerContainer('microsoft/azure-cli') {
withEnv(['HTTPS_PROXY=mycompany.de:8080']) {
sh 'env'
}
}
}
}
}
}
I think the origin of this bug is this line: https://github.com/jenkinsci/docker-workflow-plugin/blob/648f335899c5229fb8a6e889739db9cfb15de890/src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java#L130
Where every enivronment variable that matches the host variables is removed.
Currently the workaround is to explicitly set the environment variable:
withDockerContainer(args: '-e HTTPS_PROXY=mycompany.de:8080', image: 'microsoft/azure-cli') { // some block }