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

Add Capability for 'Docker Runner' to connect to private image registry

XMLWordPrintable

    • 12
    • 1
    • 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.

      Problem Definition

      Currently, Docker Runner only connects to public Docker Image Registries to pull images from, such as hub.docker.com

      Please add the capability to connect to private registries to pull images.

      Suggested Solution

      Allow auth to private registries through input credentials, or the Shared Credentials

      Workaround

      Remote Agents 

      Add the docker login command to the .profile of the Remote Agent user, for each Agent which will be using the Docker Runner build capability.

      docker login -u <username> -p <password> <registryhost:port>
      

      To keep from having passwords stored in plain text in a script you can use the credential helper as outlined in the documentation for docker login

      Elastic Agents

      1. From the top navigation bar select    > Elastic Bamboo > Image configurations.
      2. Select your preferred elastic image configuration and select edit 
      3. Scroll down to Instance startup script section.
      4. Add the script below and save. Ensure to replace with the contents of your $HOME/.docker/config.json and your artifactory URL 
        #!/bin/bash
        export HOME=/home/bamboo
        cd $HOME
        mkdir .docker && chmod 700 .docker 
        cat > .docker/config.json << EOF
        {
            "auths": {
                "private_registry_URL": {
                    "auth": "AUTH_TOKEN"
                }
            }
        }
        EOF
        chown -R bamboo:bamboo .docker 

              Unassigned Unassigned
              rwatson@atlassian.com Robert W (Inactive)
              Votes:
              58 Vote for this issue
              Watchers:
              44 Start watching this issue

                Created:
                Updated: