How to Docker Behind Proxy

How to configure docker behind an enterprise firewall

Edit the file http-proxy.conf:

It is located in /etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment="HTTP_PROXY=http://:@proxy.micorp.es:8080" "NO_PROXY=myregistry.micorp.es" 

Sometimes it is also required to update the DNS server, you can do it in the file /etc/docker/daemon.json:

{"dns": ["192.168.20.5","192.168.20.5"]}

If we are using a docker registry without https we will complete this with:

{
"dns": ["192.168.20.5","192.168.20.5"],
"insecure-registries" : ["172.22.245.193:5000"]
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s