Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-13869

Problem with Environment Variables while pulling an image from GCR

    XMLWordPrintable

Details

    Description

      So I'm trying to use an image from my Google Container Registry, since this is a private registry I need to authenticate.

      Obviously I don't want to renew my auth token every hour to make my pipelines work, so I need to go for the json key file.

      It works when I define the image as follows:

      #!yaml
      image:
         name: eu.gcr.io/project_id/image:latest
         username: _json_key
         password: >
            {JSON file content}
         email: pipelines@bitbucket.com
      

      But that means your json key file is out in the open available for everyone with access to the pipelines fine to see, not what I'd like.

      Then I've put the contents of the JSON file into an Environment Variable and replaced the actual json with the environment variable as follows:

      #!yaml
      image:
         name: eu.gcr.io/project_id/image:latest
         username: _json_key
         password: >
            ${JSON_KEY}
         email: pipelines@bitbucket.com
      

      Somehow in the second scenario it doesn't work

      Attachments

        Activity

          People

            Unassigned Unassigned
            8e79326f1674 Tjeerd Ritsma
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: