You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.