In my case, my Dockerfile is written like a template containing placeholders which I'm replacing with real value using my configuration file.
So I couldn't specify this file directly but pipe it into the docker build like this:
sed "s/%email_address%/$EMAIL_ADDRESS/;" ./Dockerfile | docker build -t katzda/bookings:latest . -f -;
But because of the pipe, the COPY
command didn't work. But the above way solves it by -f -
(explicitly saying file not provided). Doing only -
without the -f
flag, the context AND the Dockerfile are not provided which is a caveat.