docker-compose-buildkite-plugin icon indicating copy to clipboard operation
docker-compose-buildkite-plugin copied to clipboard

Automatically propagate environment variables into the container

Open patrobinson opened this issue 8 years ago • 6 comments

When setting pipeline environment variables it commonly catches me and other people in our company out that these variables are not shared with the container. We can specify them manually in the docker-compose file, but it would be nice if this was done automatically.

patrobinson avatar Jul 20 '17 10:07 patrobinson

We've discussed doing this before. It's certainly something that comes up a fair bit, I regularly forget to pass through env.

The hard part is that there is no reliable way to figure out what environment to pass in, which would mean we'd have to pass in everything that was in the env. The danger there is that you would expose things like secrets to containerized software, which would surprise a lot of people.

Would you expect that all env that was set in things like hooks would make it through, or just thing set in the global pipeline environment section?

lox avatar Dec 01 '17 00:12 lox

Just those set in the global and local pipeline environment sections. even if it were behind a flag, this would be very helpful

patrobinson avatar Dec 01 '17 04:12 patrobinson

We will likely mirror the propagate-environment config from https://github.com/buildkite-plugins/docker-buildkite-plugin#propagate-environment-optional-boolean.

lox avatar Dec 26 '18 04:12 lox

Having just seen the confusion not auto-propagating just caused with setting up junit annotations, I reckon we should add this option and set it on by default (and bump the version). Will make for a much smoother onboarding experience from other systems if you were expecting CI=true to be set, for example.

toolmantim avatar Mar 09 '19 07:03 toolmantim

We're at 3.1.0 now are we able to add this to a future major version release?

patrobinson avatar Nov 27 '19 02:11 patrobinson

/me logs on and checks the status…

jufemaiz avatar Nov 12 '20 02:11 jufemaiz

huzzah!

jufemaiz avatar Oct 10 '22 23:10 jufemaiz