[JIRA] (JENKINS-42369) agent docker parameters do not honor the current environment

4 views
Skip to first unread message

sven.carstens@udg.de (JIRA)

unread,
Feb 28, 2017, 5:41:01 AM2/28/17
to jenkinsc...@googlegroups.com
Sven Carstens created an issue
 
Jenkins / Bug JENKINS-42369
agent docker parameters do not honor the current environment
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2017/Feb/28 10:40 AM
Priority: Minor Minor
Reporter: Sven Carstens

Currently I need to use multiple docker containers which need to be linked together.
I tried using the --link option to set the linked image. In my use-case I don't want to set a fixed name but need to use a variable for the name.

In this case the args parameter is evaluated to "--link null:linkedimage" and the job fails.

Or is there another way to pass dynamic parameters (from variables) to the docker args?

pipeline {
    agent any
    environment {
        LINK_DOCKER_IMAGE = "linkedimage"
    }
    stages {
        stage ('Compose') {
            agent {
               docker {
                    image 'alpine'
                    args  "--link ${env.LINK_DOCKER_IMAGE}:linkedimage"
                }
            }
            steps {
                    sh 'printenv'
            }
        }
    }
}
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

gdupin@gmail.com (JIRA)

unread,
Dec 5, 2018, 9:52:04 AM12/5/18
to jenkinsc...@googlegroups.com
Guillaume Dupin commented on Bug JENKINS-42369
 
Re: agent docker parameters do not honor the current environment

Hi !
This bug is very troubelsome for us and the workarounds does not work in all cases... and are workarounds
Would it be possible to change the priority to accelerate the fix please ?

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

gdupin@gmail.com (JIRA)

unread,
Dec 5, 2018, 9:52:09 AM12/5/18
to jenkinsc...@googlegroups.com
Guillaume Dupin updated an issue
 
Change By: Guillaume Dupin
Comment: Hi !
This bug is very troubelsome for us and the workarounds does not work in all cases... and are workarounds ;)

Would it be possible to change the priority to accelerate the fix please ?

gdupin@gmail.com (JIRA)

unread,
Dec 5, 2018, 9:52:10 AM12/5/18
to jenkinsc...@googlegroups.com
 
Re: agent docker parameters do not honor the current environment

Hi !
This bug is very troubelsome for us and the workarounds does not work in all cases... and are workarounds


Would it be possible to change the priority to accelerate the fix please ?

vlassov@magnum.kz (JIRA)

unread,
Dec 26, 2018, 4:46:02 AM12/26/18
to jenkinsc...@googlegroups.com

Same issue. I am using a dockerfile agent and there is no way (or I don't know one) to pass environment variables to the "docker build" command. Example:

pipeline {
    environment {
        SSH_KEY = credentials('ssh-key')
    }
    agent {
        dockerfile {
            additionalBuildArgs "--build-arg SSH_KEY=${SSH_KEY}"
        }
    }
    stages {
        stage('Test') {
            steps {
                sh 'go test'
            }
        }
    }
}

vfratila@adobe.com (JIRA)

unread,
Jul 3, 2019, 8:09:06 AM7/3/19
to jenkinsc...@googlegroups.com

It would be great for env vars to work with env vars.

Jorge.w.machado@hotmail.com (JIRA)

unread,
Jul 28, 2019, 6:47:03 AM7/28/19
to jenkinsc...@googlegroups.com

I have another use case for this. Running builds with nvidia-docker we need to pass NV_GPU= 0,1 at container start ... This does not work with the environment directive

philippjung2010@live.de (JIRA)

unread,
Nov 26, 2019, 6:02:03 AM11/26/19
to jenkinsc...@googlegroups.com

Same issue here. Any chance to change the priority?

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages