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
Hi, I am trying to modify the existing docker bamboo server image to suit my requirements like installing old maven version and other software's for capabilities through building docker file from Atlassian/bamboo-server image. But i am getting few issue as below while running the docker file.
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
also if i use sudo in docker file i get the below error.
/bin/sh: 1: sudo: not found
can someone please suggest a solution or the correct way to customise the bamboo server image to suit my requirements by downloading different capabilities.
Thank you in advance.
Hey @Akshithp_Reddy ! I'll show you how you can achieve this.
Firstly: Docker containers are meant to be "disposable" - if you destroy it and recreate it with the same configuration, you shouldn't lose anything. That being the case, I don't recommend installing packages in a running container - aside from the issues you ran into, it means that if you need to change some part of the container config, when you destroy and recreate it you'll need to install those packages all over again.
Instead, what you should do is build a new Docker image using our image as the base. For example, you might want to install NodeJS. You would create a new Dockerfile that looked like this:
RUN apt-get update && apt-get install -y nodejs
Then you could build this image from your terminal by entering the directory containing your Dockerfile and running the following command:
docker build -t "atlassian/bamboo-server:7.0.2-custom" .
(You could tag it with whatever name you want; the above is just an example)
Then, simply run Bamboo using the custom image you created. This is, in essence, how Docker is intended to work - you can use the stock images out there directly, or you can use them as a base image to build upon and customise according to your needs.
I hope that helps!
Hi @Dave Chevell Thank you very much for the explaining the procedure, i did the same in the Dockerfile and tried creating the custom image using the docker build tool but i see the following error when running the build, not only nodejs i tried installing other packages on the base image but the issue is same.
Sending build context to Docker daemon 4.096kB
Step 1/2 : FROM atlassian/bamboo-server:7.0.2
Step 2/2 : RUN apt-get update && apt-get install -y nodejs
---> Running in cad6cc8e743f
Reading package lists...
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
The command '/bin/sh -c apt-get update && apt-get install -y nodejs' returned a non-zero code: 100
I also tried modifying the permissions for the directories showed in the above error, but its still the same, can you please suggest any workaround for this error.
Also i am trying to run the customized bamboo-server image in docker container and triggering the build/plans using commands on command line interface as in linux/unix commmads, instead of using the GUI to start the build . are there any options in that way to trigger the build from the CLI. If yes can you please share the info that would be a great help. Thank you.