buildx icon indicating copy to clipboard operation
buildx copied to clipboard

Allow `.env` file override (equivalent to docker-compose build's `--env-file` option) when using bake

Open salimepoint opened this issue 2 years ago • 1 comments

As a follow up to #282

Depending on our build type (dev/ci/prod) we use different versions of a .env file when running our builds with docker-compose build. Would it be possible to add a --env-file option to bake so it can provide the same functionality?

salimepoint avatar May 17 '22 19:05 salimepoint

I am running into same issue, e.g. we modify default .env to .ghcr.env and want .ghcr.env to be picked up when building on github actions. So looking for below command to work. Will be great is this problem can be resolved in a some elegant way as requested by @salimepoint.

docker buildx bake -f docker-compose.yml -f .ghcr.env

saurabhdes avatar Oct 02 '22 19:10 saurabhdes