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,641,978
Community Members
 
Community Events
196
Community Groups

Multi-stage docker build support (using --target in build) does not appear to work

docker build --target build_stage_target -t build_name . 

 

Running the above command in my pipelines does not produce the desired results. The --target flag is apparently ignored, and the build runs all stages before and after the specified stage.

 

Is this indeed not supported or could I be doing something wrong?

 

 

1 answer

This is really an issue 😭
@Jason Ryandid you solve the problem?

Sadly I did not :( 

Hi @Jason Ryan 👋

In our team we found the answer. This is not a Bitbucket issue, but the Docker itself. BuildKit fixes this bug in multi-stage builds in the legacy docker build engine.

So, just enable the BuildKit by inserting the line

- export DOCKER_BUILDKIT=1

before the docker build command and the image will be built with the specified target.

So simple, bro))

Like Jason Ryan likes this

Fascinating. Thank you for sharing!

Like Maxim Ugryumov likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events