Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,392
Community Members
 
Community Events
184
Community Groups

bitbucket-pipelines, build using ACR

Hi, I have tried to solve this problem but have failed.

I need to build a docker image using bitbucket-pipelines and ACR.

I need examples of how to write the bitbucket-pipelines.yml

using 'az acr build' and how to push the image into ACR.

 

Please advise.

/Bo Christensen

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 20, 2023

Hi Bo,

Just to give you some context, Pipelines builds run in Docker containers. For every step of your build, a Docker container starts using the image you have specified in your bitbucket-pipelines.yml file. The repo is cloned in that container, and then the commands of the step's script are executed. When the step finishes that Docker container gets destroyed.

If you want to execute commands like 'az acr build', the Azure CLI needs to be installed on the Docker image that is specified as a build container in your bitbucket-pipelines.yml file. Microsoft provides the Docker image mcr.microsoft.com/azure-cli that has Azure CLI pre-installed. You can use it by specifying it in your bitbucket-pipelines.yml file as follows:

image: mcr.microsoft.com/azure-cli

This is the documentation for the Docker image options in bitbucket-pipelines.yml

If you use a different Docker image as a build container, you will need to install Azure CLI in the container by adding the necessary commands in the script of your step. So, it may be easier to use mcr.microsoft.com/azure-cli instead.

You should then be able to use commands from Azure CLI in the script of your step. For the exact commands that you need to use, you will need to check Azure CLI documentation:

If you have any questions, please feel free to reach out.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events