This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
dockerproxy [2016/11/30 23:57] moliver |
dockerproxy [2016/12/01 00:08] moliver |
||
---|---|---|---|
Line 3: | Line 3: | ||
**IMPORTANTE:** Los sitios hub.docker.com y los registros están bloqueados para Cuba por Estados Unidos debido al bloqueo. Se debe crear un tunel o una vpn para evitar esta limitación. Esta ayuda asume que eso ya está hecho para los sitios: hub.docker.com, registry.hub.docker.com, registry-1.docker.io, index.docker.io y auth.docker.io. Algunos de ellos responden a varias direcciones IPs. | **IMPORTANTE:** Los sitios hub.docker.com y los registros están bloqueados para Cuba por Estados Unidos debido al bloqueo. Se debe crear un tunel o una vpn para evitar esta limitación. Esta ayuda asume que eso ya está hecho para los sitios: hub.docker.com, registry.hub.docker.com, registry-1.docker.io, index.docker.io y auth.docker.io. Algunos de ellos responden a varias direcciones IPs. | ||
+ | De forma tradicional docker se podría ejecutar así a través de un proxy: | ||
+ | <code> | ||
+ | HTTP_PROXY=http://192.168.1.1:3128/ docker pull busybox | ||
+ | </code> | ||
+ | Pero en las últimas versiones de Debian y Ubuntu docker es manejado a través de systemd por lo que se pueden realizar los ajustes de otra forma. | ||
- | Docker uses the HTTP_PROXY environment variable if present, for example: | + | Crear el direcotio /etc/systemd/system/docker.service.d |
+ | si no existe: | ||
+ | <code> | ||
+ | mkdir -p /etc/systemd/system/docker.service.d | ||
+ | </code> | ||
- | HTTP_PROXY=http://192.168.1.1:3128/ docker pull busybox | + | Creat el archivo http-proxy.conf: |
+ | <code> | ||
+ | cat > /etc/systemd/system/docker.service.d/http-proxy.conf << 'EoT' | ||
+ | [Service] | ||
+ | Environment="HTTPS_PROXY=http://10.12.1.7:3130/" "HTTP_PROXY=http://10.12.1.7:3130/" "NO_PROXY=localhost,127.0.0.1,nexus.uclv.edu.cu" | ||
+ | EoT | ||
+ | </code> | ||
- | But instead, I suggest you have a look at your /etc/default/docker configuration file : you should have a line to uncomment (and maybe adjust) to get your proxy settings applied automatically. | + | Nótese como se pueden poner excepciones. |
- | # If you need Docker to use an HTTP proxy, it can also be specified here. | + | Luego se debe actualizar la configuracion del systemd |
- | #export http_proxy="http://127.0.0.1:3128/" | + | <code> |
+ | systemctl daemon-reload | ||
+ | </code> | ||
+ | |||
+ | y reiniciar el servicio: | ||
+ | <code> | ||
+ | service docker restart | ||
+ | </code> | ||
- | Then restart the Docker server: | ||
- | service docker restart | ||