Reputation: 6981
I need the output of a command run on the host to be used further in a Dockerfile.
Something like this:
ARG version
version = `cat version.txt` <--- this has to be run on the host
RUN sed -i "s/VER*/$version/g" /file/in/container
Is it clear what I mean? :) How to do this?
Upvotes: 1
Views: 690
Reputation: 11980
What about using this command:
docker build --build-arg version=$(cat version.txt) .
The Dockerfile (Update: I have removed ENV
and used the value of ARG
directly)
ARG version
RUN sed -i "s/VER*/${version}/g" /file/in/container
Upvotes: 2