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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


How does one set up a Docker build step in Bamboo?

I am currently despairing at the attempt of setting up a docker build step in Bamboo.

For starters, I just want to create a build configuration that runs the hello-world image as a proof of confluence. So far, I have failed.

I have tried following the steps on , but to no avail.

My setup is this:
We have Bamboo installed on an Ubuntu server. I also installed Docker on that server and added the `bamboo` user to the `docker` usergroup and restarted the server to make sure the permission change takes effect. At this point, `docker run hello-world` works when I run it directly on the server. I can also confirm that this is the server that Bamboo runs on since Bamboo went offline whenever I restarted the server that I installed Docker on.

Then, I have added the docker capability to the server (the agent is the default agent, so it inherits this capability from the server). As the docker path, I have tried various things, none of which worked (aka, the following errors remained the same for each of these):

* `/snap/docker` (the first folder that I found on a manual search)
* `/usr/bin/docker` (the recommended path, though on inspecting the Ubuntu server I quickly found out that no `docker` folder exists under `/usr/bin` on the Ubuntu derver)
* `/var/snap/docker/common/var-lib-docker ` (the path that Docker returns as its Root Directory when I run `docker info` on the Ubuntu server)
* `/var/snap/docker` (for good measure)

Now, for the runner, I have tried two different approaches.

First, I tried using a Docker runner with the following settings:
**Command:** Run a Docker container
**Docker image:** hello-world

This returns the following error message:

Error occurred while running Task 'Hello World Docker Test(5)' of type Failed to execute task

Caused by: com.atlassian.bamboo.docker.DockerException: Error running Docker run command

Caused by: com.atlassian.utils.process.ProcessException: Error executing /snap/docker run --volume /var/atlassian/application-data/bamboo/xml-data/build-dir/CAM-DOC-JOB1:/data --workdir /data --rm hello-world


The second was just to run a shell runner for the command `docker run hello-world`, which returned the following error:
docker: not found

At this point, I feel like I'm out of ideas. Everything points towards Bamboo for some reason not finding Docker on the server, even though I can clearly confirm that it is there. I have tried various different approaches of telling Bamboo where to find Docker, but none of them have worked.

It's obvious that I'm doing something wrong, but I can't figure out what. Or maybe the problem lies in an entirely different direction altogether? Anyway, I would be grateful for any insight shared on this matter.

1 answer

1 accepted

1 vote
Answer accepted

Okay, I found out what caused this strange behaviour.

The problem was that I installed Docker using `sudo snap install docker`, and apparently installing docker via snap causes problems with Bamboo.

So I got it to work using these simple steps:

1. [Server] Uninstalled Snap Docker using `sudo snap remove docker`
2. [Server] Reinstalled Docker using `sudo apt install`
3. [Bamboo] Changed the path to Docker in the Server Capabilities to `/usr/bin/docker`

After that, the hello-world image build succeeded and printed the expected output to the log.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events