Hi Atlassian Support,
I’m reaching out to understand whether there is a supported way to use Docker images hosted in Bitbucket Packages as base images within Bitbucket Pipelines without relying on personal API tokens.
Current situation:
Problem:
What we’re looking for:
If this is not currently supported, we would appreciate any guidance on:
This capability would significantly improve reliability and reduce maintenance effort for teams managing multiple repositories.
Thanks in advance for your help.
Kind regards
Hello and welcome to the Community @James Zhang
You should be a bit careful with the current reply in my opinion.
What Atlassian clearly documents today is that Bitbucket Packages uses crg.apkg.io, and that Pipelines has built-in package credentials through BITBUCKET_PACKAGES_USERNAME and BITBUCKET_PACKAGES_TOKEN.
What you do not really see documented is repository, project, or workspace access tokens as the standard auth method for Bitbucket Packages registry access. Atlassian documents those tokens for Bitbucket API and Git usage.
You shouldn't treat that token suggestion as confirmed. You are on firmer ground if you stick to the Packages auth methods Atlassian actually documents.
Can you clarify one point? do you need that image as the actual top-level pipeline image, or do you only need to pull it later inside the step? If it is the top-level build image, you would want Atlassian staff to confirm the supported auth path before you roll that out across hundreds of repos.....
Hi @James Zhang
Welcome to the community!
This is a common pain point. The good news is there is a supported way to avoid personal API tokens for this — use Repository Access Tokens or Workspace Access Tokens, which are non-personal and can be rotated/managed independently.
Recommended solution
read:repository:bitbucket scope.DOCKER_TOKEN) in your repository or workspace settings.bitbucket-pipelines.yml, authenticate to the registry using the token:
image:
name: packages.atlassian.net/your-image:tag
username: x-token-auth
password: $DOCKER_TOKEN
This avoids personal tokens entirely. Workspace-level tokens are the best option for hundreds of repos since one token can be used across all of them via a workspace-level pipeline variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.