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
Next: Root
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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi All,
Thanks for creating such a wonderful tool for automations.
Am currently working on a project where I need to create Docker task to build and push the image to a nexus repo.
Here is my sample docker file (Specify the Dockerfile contents in the tasks)
# Base
FROM openjdk:8-jdk-alpine
# Add App
RUN mkdir -p /app/config
EXPOSE 8080/tcp
EXPOSE 10389/tcp
The above works perfectly fine.
Now I wanted to push some values into this docker file to make it more generic.
So I defined under variable of that same bamboo tasks a key value pair given below.
key=BASEIMAGE
value=openjdk:8-jdk-alpine
and changed my dockerfile to below: (Specify the Dockerfile contents i nthe tasks):
# Base
FROM ${bamboo.BASEIMAGE}
# Add App
RUN mkdir -p /app/config
EXPOSE 8080/tcp
EXPOSE 10389/tcp
The above works perfectly fine too and swap the ${bamboo.BASEIMAGE} to "openjdk:8-jdk-alpine"
The issue appears when I save the same Dockerfile to a git repo and try to use the option "Use an existing Dockerfile located in the task's working directory" to pull the dockerfile while creating the docker build image from th erepo.
The same dockerfile throws error.
Error:
Sending build context to Docker daemon 23.06MB build 11-Feb-2020 13:06:31 build 11-Feb-2020 13:06:31 Step 1/4 : FROM ${bamboo.BASEIMAGE} error 11-Feb-2020 13:06:31 failed to process "${bamboo.BASEIMAGE}": missing ':' in substitution
I am not sure why it is throwing error. As the dockerfile is not changed at all or is there a different way to get the env variables into Dockerfile using repo