colima icon indicating copy to clipboard operation
colima copied to clipboard

HTTP_PROXY not working for docker runtime

Open kigawas opened this issue 2 years ago • 7 comments

It seems colima does not respect HTTPS_PROXY when starting the vm

kigawas avatar Feb 02 '22 09:02 kigawas

OK, after deleting the vm and starting with containerd context it works

kigawas avatar Feb 02 '22 09:02 kigawas

it does not work with the docker daemon, though.

aruder77 avatar Feb 08 '22 12:02 aruder77

@aruder77 is that still the case?

abiosoft avatar Mar 07 '22 11:03 abiosoft

I just tried with colima version 0.3.4. The HTTP(S)_PROXY is honored when using containerd, but it is not working when using the docker daemon. Images cannot be pulled via proxy in this case.

aruder77 avatar Mar 14 '22 07:03 aruder77

Trying to help... As a workaround Into the vm (colima ssh), I have edited the docker service file (/etc/init.d/docker) to set HTTP_PROXY variables directly: export HTTP_PROXY=192.168.5.2:8888 export HTTPS_PROXY=192.168.5.2:8888

after a vm restart (colima stop, colima start) I can pull images using the proxy

oglezglez avatar Mar 16 '22 12:03 oglezglez

Trying to help... As a workaround Into the vm (colima ssh), I have edited the docker service file (/etc/init.d/docker) to set HTTP_PROXY variables directly: export HTTP_PROXY=192.168.5.2:8888 export HTTPS_PROXY=192.168.5.2:8888

after a vm restart (colima stop, colima start) I can pull images using the proxy

Great! That works! Thanks for you help. I can live with this workaround for now...

aruder77 avatar Mar 25 '22 07:03 aruder77

Looks like lima will copy your proxy env vars into /etc/environment already . Alpine uses openrc to start services. Openrc blocks passing the env vars into the start up scripts unless you set it to allow them in the /etc/rc.conf.

I run echo 'rc_env_allow="*"'|colima ssh -- sudo tee -a /etc/rc.conf then stop and start Colima and it seems to do the trick. I can't seem to get it to work when specifying the individual proxy vars and had to resort to using the '*'.

tkilloren avatar May 06 '22 14:05 tkilloren