user7692855
user7692855

Reputation: 1428

Can docker-compose / dockerfile access host env vars at build time?

Is it possible for a dockerfile / docker compose file to access the host env vars at build time when running docker-compose build app or do you have to manually pass them into the build command?

Upvotes: 1

Views: 28

Answers (1)

Ryan Cahill
Ryan Cahill

Reputation: 742

Environment variables from the host that you want to use at build time would need to be passed into the build command with the --build-arg flag described here.

Upvotes: 1

Related Questions