oci-build-task icon indicating copy to clipboard operation
oci-build-task copied to clipboard

Is http proxy usage during build supported ?

Open L4R5 opened this issue 6 years ago • 2 comments

I wanted to switch from docker-image resource to oci-build-task for image creation. It seems oci-build-task does not support usage of http proxy during the build.

This is some example log output from a build of a Ubuntu based image. The http proxy is configured in concourse and usually all tasks have the http_proxy variables set

#5 [2/10] RUN apt-get update --fix-missing && apt-get -y upgrade
#5 0.169 Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
#5 0.169   Could not resolve 'archive.ubuntu.com'
#5 0.169 Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
#5 0.169   Could not resolve 'security.ubuntu.com'
#5 0.169 Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
#5 0.169   Could not resolve 'archive.ubuntu.com'
#5 0.170 Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
#5 0.170   Could not resolve 'archive.ubuntu.com'
#5 0.173 Reading package lists...

L4R5 avatar Oct 22 '19 13:10 L4R5

Hi @L4R5, I have not tried this but I hope passing in build args should work for you.

oci_build_task does support passing in build args. See https://github.com/vito/oci-build-task#params

So, passing in build args like below should work:

params: BUILD_ARG_HTTP_PROXY: ((your-proxy-url)) BUILD_ARG_HTTPS_PROXY: ((your-proxy-url))

Can you try this and confirm if this works?

clutonik avatar Apr 18 '21 02:04 clutonik

@clutonik this works for me, many thx

Budy-Love avatar Jan 24 '24 13:01 Budy-Love