Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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

How to use a shared Dockerfile in the Docker task

In bamboo, I have created 2 stages. In the first one, I check out the source code and compile it. I've also created an artifact that is the Dockerfile located in the checked out directory and shared it. In the second stage, I've defined an artifact dependency which is the artifact I've created earlier in the previous stage.  For the destination directory, I've specified ../CAS-CR-JOB1/download-data/.  I've chosen the "Use an existing Dockerfile located in the task's working directory" option to make my intention clear that I want to use the shared Dockerfile. But I get "no such file or directory" when I run the plan.

To be honest, I doubt that the "Use an existing Dockerfile located in the task's working directory" should enable using the shared artifact, because the artifact is in the donor job's build directory. I can verify this by running the ls command. It shows an empty list. But if I try 'ls ../CAS-CR-JOB1/download-data' I get the Dockerfile listed.

So how would I use the Dockerfile produced from the previous stage and build that? What am I doing wrong?

1 answer

1 accepted

0 votes
Answer accepted

It turns out that if I want to have the shared artifact available in the current jobs working directory, then when creating the artifact dependency, in the Destination directory field I should write ".". After I did that, the problem got fixed.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events