Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo docker task - how to build image Edited

Hi,

I'm trying to build (and eventually run) a docker image in a task. I'm a bit confused with what needs to be given as the "Repository"? Is this where the image should be taken, or where the output (resulting image) will need to go?

I have a local directory containing my DockerFile, together with the files the it needs (requirements, etc). How can I access this directory? Is this what the subdirectory is meant for, and if so, will it work with the directory path or does this need to be copied into the bamboo root directory?

I'd appreciate any clarifications.

Thanks!

1 answer

0 votes
edwin Community Leader Apr 22, 2019

Hi @Din Tamari ,

Repository is the name of the image you are building.

I have a local directory containing my DockerFile, together with the files the it needs (requirements, etc). How can I access this directory?

You'll use source control here.

For example Git.

In your local directory: run the following commands

  1. git init
  2. git add *
  3. git commit -m "Initial commit"

Next step would be to push the commit to a remote repository like Bitbucket, but you can work with a local repository.

In Bamboo

  1. Under Plan Configuration > Repositories
    1. Add your git path repository as URL
      1. /path/to/repo.git 
  2. Now under tasks
    1. Add a Source Code Checkout task
      1. Recommended to use Force Clean Build 
    2. Add Docker build task
      1. Specify a image name
      2. Choose: Use an existing Dockerfile located in the task's working directory

Hi @edwin

thanks for the response! I've followed your steps and have additionally:

 

1. Pushed the repo to github
2. Provided the ssh for accessing the github repo
3. Set up a docker capability for a new agent
--> For this, I created a new Agent with Docker capabilities and set the path to: C:/Program Files/Docker/Docker (I'm on windows).

 

When I try running the plan, I get the following error: Error occurred while running Task 'build docker image(2)' of type com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli. 

 

Do you have any idea what the problem could be?

Could it be due to the docker path I am providing? I've also tried setting it to: C:/Program\ Files/Docker/Docker and C:\Progra~1\Docker\Docker 

 

I've also tried using a basic docker example to see if worked, following the task configuration found here: https://jira.atlassian.com/browse/BAM-17729 and I am getting the same error message.

Thanks!

edwin Community Leader Apr 22, 2019

@Din Tamari 

Specify a path to the .exe file

C:\Program Files\Docker\docker.exe

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

179 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you