Reputation: 3497
I know several ways to set env variables while building an image: I can use ARG or ENV in Dockerfile.
Also I know I can pass text file with variables to docker run command and get env variables set this way: docker run --env-file=env_file_name alpine env
What I want to understand is how can I pass text file with env variables to by image during build. I.e. I want to use something like
docker build use-env-file=.env
or
buildah bud use-env-file=.env
Is it possible?
Upvotes: 0
Views: 377