3

I'm trying to run a simple alpine docker image on rhel 7, but i'm stuck in this error when i run apk update:

fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/main: could not connect to server (check repositories file)
WARNING: Ignoring APKINDEX.00740ba1.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/community: could not connect to server (check repositories file)
WARNING: Ignoring APKINDEX.d8b2a6f4.tar.gz: No such file or directory
2 errors; 14 distinct packages available

I run these commands:

docker run -it --rm --env="http_proxy=http://127.0.0.1:3128" alpine /bin/sh
apk update

I'm behind a ssh tunnel proxy in the virtual machine. I've set /etc/docker/daemon_config.json, /etc/systemd/system/docker.service.d/http.proxy.d, enviroment variables and dns.

What can i do?

  • 1
    `--env="http_proxy=http://127.0.0.1:3128"` Are you running the proxy inside the docker container ? Because this is where your container will look for it with this env set. If your proxy is on your host, you need to replace 127.0.0.1 by the ip of the docker bridge (or whatever you used for networking that is available and resolves to your host). – Zeitounator Dec 03 '19 at 17:33
  • @Zeitounator The proxy is on my pc but is tunneled to the virtual machine, so i've done ifconfig to take docker bridge's ip address looking at docker0; the resulting ip was 172.17.0.1, the default. I'm running the command with --env="http_proxy=http://172.0.0.1:3128" but nothing different happens. – Alessio Pascucci Dec 04 '19 at 07:27
  • Did you check that the proxy is fully accessible from the container ? – Zeitounator Dec 04 '19 at 08:22
  • @Zeitounator How can i check it? – Alessio Pascucci Dec 04 '19 at 08:51
  • [This](https://stackoverflow.com/questions/55079577/docker-connectivity-issue-apt-apk-do-not-work-inside-docker-container-and-durin?answertab=active#tab-top) was helpful for me. – Zeinab Abbasimazar Feb 18 '20 at 14:26

0 Answers0