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

Docker task should allow variables to be used in the docker image/repository name

    • 1
    • 3
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      The Docker task does not allow using variables to point to the name of the image to be used for the task.

      The repository field in the "Build a Docker Image" and "Push a Docker image to a Docker registry" commands prevents the ${variable} syntax from being entered, as it does not meet the regex requirements for a Docker repository name.

      The Docker image field in the "Run a Docker container" command does allow the ${variable} syntax, but does not substitute the variable when attempting to run the container, and the Docker daemon returns an error.

          Form Name

            [BAM-16361] Docker task should allow variables to be used in the docker image/repository name

            To anyone who might wonder the same thing: you can create a 'script' job with inline content: "docker push ${bamboo.variable}" or similar.

            Deleted Account (Inactive) added a comment - To anyone who might wonder the same thing: you can create a 'script' job with inline content: "docker push ${bamboo.variable}" or similar.

            Does anyone have a proper workaround for this? I could use imageName:latest but if you have several build branches you're never sure which one you'll get, and re-running a deployment might get you a different image.

            Deleted Account (Inactive) added a comment - Does anyone have a proper workaround for this? I could use imageName:latest but if you have several build branches you're never sure which one you'll get, and re-running a deployment might get you a different image.

            The ability to put version tags on Docker containers that match up with the release names used in Bamboo is an "essential" feature for a successful Docker/Bamboo integration. Please add this capability! At the moment, all my containers are being generated without any version information.

            John Fisher added a comment - The ability to put version tags on Docker containers that match up with the release names used in Bamboo is an "essential" feature for a successful Docker/Bamboo integration. Please add this capability! At the moment, all my containers are being generated without any version information.

            Nick added a comment -

            but, I keep getting the error message "Invalid container name (a), minimum length is two characters and only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed"

            You should be able to use variables in a container name.  Otherwise, I can't build two branches at once as there can't be two containers w/ the same name running at the same time. Very frustrating.

            Nick added a comment - but, I keep getting the error message "Invalid container name (a), minimum length is two characters and only [a-zA-Z0-9] [a-zA-Z0-9_.-] are allowed" You should be able to use variables in a container name.  Otherwise, I can't build two branches at once as there can't be two containers w/ the same name running at the same time. Very frustrating.

            Nick added a comment -

            Just ran into this as well. Currently trying to "Start a Docker container", but I'd like to tag that container's name based off the branch that I'm currently building.  Trying to use a variable such as:

             

            {$bamboo.planRepository.branch}

            Nick added a comment - Just ran into this as well. Currently trying to "Start a Docker container", but I'd like to tag that container's name based off the branch that I'm currently building.  Trying to use a variable such as:   {$bamboo.planRepository.branch}

            This relates to resp. duplicates BAM-15861, where we have added more details on how the underlying field validation fails to properly account for variables (but still allows specific variations for variable input by chance).

            Steffen Opel [Utoolity] added a comment - This relates to resp. duplicates BAM-15861 , where we have added more details on how the underlying field validation fails to properly account for variables (but still allows specific variations for variable input by chance).

              851f15845f55 Mateusz Szmal
              2f57b7ccfdfb Nick Allen
              Votes:
              39 Vote for this issue
              Watchers:
              19 Start watching this issue

                Created:
                Updated:
                Resolved: