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