I'm trying read application version from a file VERSION such that echo -n 1.0.0 > VERSION, and store the version number in an environment variable, lets say, VERSION. My Dockerfile
FROM debian
WORKDIR /app
COPY VERSION .
ENV VERSION $(cat VERSION)
# I'd like to use the version number in later steps like
RUN apt update && apt install -y curl
RUN curl path/to/executable-${VERSION}
env | grep VERSION returns:
VERSION=$(cat VERSION)
I want
VERSION=1.0.0
RUN curl path/to/executable-$(cat VERSION)