Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-16989

Docker Task configuration doesn't expand environment variables

    XMLWordPrintable

Details

    Description

      Remote Agent with Docker capability has environment variable $USER set to 'santa'.

      Create a Plan which runs 2 tasks.
      First task is a Script Task, that just does an "echo user=$USER".
      Second Task is a Docker Task, which runs an ubuntu container.

      Configure Docker task with:
      Container command = /bin/bash -c "env|sort"
      Container environment variables = $WHO_C=$USER $WHO_C2='claus'
      Advance > Environment variables = $WHO_E=$USER $WHO_E2='claus'

      The agent buildlog shows that the Script Task correctly shows "user=santa".

      It then starts the Docker Task with
      command line: /bin/docker run -e $WHO_C2=claus -e $WHO_C=$USER
      environment: $WHO_E=$USER $WHO_E2=claus

      The $USER environment variable is not expanded.
      This blocks the option to pass environment and Bamboo variables to the Docker container.

      Attachments

        Activity

          People

            jmajkutewicz Jan Majkutewicz (Inactive)
            rverschoor Rene Verschoor (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: