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

Support Amazon ECR for build image

    XMLWordPrintable

Details

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

    Description

      The Amazon implementation of a Docker Registry automatically generates the docker login command with a call to the aws API. The credentials that it generates expire making them impractical to mine from the command for a normal bitbucket-pipelines.yml file. As far as I can tell, there is no way to set Amazon to do it differently, so if we could specify AWS credentials as follows:

      #!yaml
      
      image:
          name: <aws-ecr-image>
          aws_login:
              access_key_id: <access_key_id>
              secret_access_key: <secret_access_key>
              region: <region>
      

      Then Pipelines could generate a file at ~/.aws/credentials that looks like this:

      #!ini
      
      [default]
      aws_access_key_id = <access_key_id>
      aws_secret_access_key = <secret_access_key>
      
      

      Then make the following AWS call to get the credentials and login:

      #!bash
      
      eval $(aws ecr get-login --region <region>)
      

      It could then proceed to download the Docker image and continue normally.

      Alternatively, the values could be settings on the server side to avoid sharing all that information in a file in source control.

      Attachments

        Activity

          People

            Unassigned Unassigned
            43d86483ce94 Michael Juliano
            Votes:
            16 Vote for this issue
            Watchers:
            22 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: