1

Is it possible to pass environmental variables as a file to a Dockerfile at the time of building a docker image?

I have used --build-arg as suggested here but as I have multiple arguments would prefer to use a file with all.

Also I have tried using docker run --env-file=mydata.env approach as well but I need to add these parameters during build time.

Thanks in advance.

1 Answer 1

0

The only way to pass a build arg in to a build using the docker build command is with the --build-arg argument. There isn't support for specifying multiple build args from a file.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for the clarification

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.