Closed finikorg closed 6 years ago
You have to pass extra options into docker containers with the environment variables you want to set. It can be done with an extra argument to the docker command.
If your proxy runs on a local IP such as loopback address you'll also need to adjust iptables forwarding because docker runs a different interface by default (eg 172.17.0.1 IIRC)
I have not tried it yet but I think it is possible to set proxy for docker in systemd service: https://docs.docker.com/engine/admin/systemd/#httphttps-proxy
@finikorg Of course I did it already, otherwise the image fetching wouldn't work. But this is for the daemon itself, not for the containers.
@superm1
Yep, I tried even adding explicit ENV
to Dockerfile
but seems like apt
doesn't use it (probably because sudo
drops by default all the environement vars). This is why I mentioned apt.conf
. Adding keep_env
to sudoers
would work too, but neither option is done easily if there is no better support from Docker.
Try using the --build-arg while generating the container. That's what I had to do to add http proxy
As I said, I did even better, I have set it directly in the Dockerfile
with ENV
.
Probably no way to make apt
to use it without adding apt.conf
or somehow changing sudoers
to include keep_env += http_proxy
I'll look when I get back to my workstation after the holiday. I've never had to configure anything in apt.conf in my container. Always did the only changes needed by docker build arguments.
We can also "push" umockdev docker image to registry.
I couldn't make it run on my machine. Seems like
apt-get
doesn't get the proxy settings. Any idea how to make it easily (preferably w/o adding a lot of commands or additional file just to build an apt.conf inside the container)?