Repository navigation
Propagate worker proxy settings when building docker images - #141
Conversation
|
@boazy Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
|
@boazy Thank you for signing the Contributor License Agreement! |
| done | ||
|
|
||
| if [ -n "$build_args" ]; then | ||
| expanded_build_args=$(echo $build_args|jq -r 'with_entries(.key |= "--build-arg " + . )|with_entries(.key = .key + "=" +.value)|keys|join(" ")') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
c328139 to
52c3620
Compare
|
@jtarchie i fixed the pull request, can you review again? |
|
Could you add a test for this? There should be some decent tests to reference under |
|
Ugh, I have no idea what's up with GitHub's conflict resolution thing (that's what made the last commit). It never works. It makes a commit but then the conflict is still not resolved. ...In any case, this is now pretty broken via conflicts with #159 and is still in need of tests. I tried to resolve the conflicts and switch it to the new buid_arg flow, but that didn't work. Do you have time to update this, @boazy? Thanks! (edit: managed to resolve the conflicts on a second try. 🤷♂️) |
c0831f5 to
ffbb60b
Compare
|
@vito Thanks for resolving the conflict and sorry for neglecting the unit tests. |
|
Sweet, thanks for following up! Tests look good, I'll go ahead and merge. |
Solves issue #131
Concourse supports passing the http_proxy family of environment variables from the workers to the containers running on them: concourse/concourse#319
These environment variables do not propagate, however, when building a docker image with docker-image-resource which leaves a pretty large blind spot. This PR fixes that by adding all present proxy setting environment variables as build arguments.
You may see this warning during docker image build if you have proxy environment variable enabled:
[Warning] One or more build-args [http_proxy https_proxy] were not consumedThis is because Docker fails to detect that these arguments are being used (even when they're used). It's thankfully harmless.