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

agent docker parameters do not honor the current environment

      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'
                  }
              }
          }
      }
      

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

          Sven Carstens created issue -
          James Dumay made changes -
          Epic Link New: JENKINS-45381 [ 183541 ]
          James Dumay made changes -
          Rank New: Ranked higher
          James Dumay made changes -
          Rank New: Ranked lower
          Guillaume Dupin made changes -
          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 ? ]
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]

            Unassigned Unassigned
            sven_carstens_udg Sven Carstens
            Votes:
            29 Vote for this issue
            Watchers:
            31 Start watching this issue

              Created:
              Updated: