I am using a corporate proxy, without authentication.
When I try the build an image based on alpine, It gives me the bellow error when I try to install a package.
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/main: DNS lookup error
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/community: DNS lookup error
I build using the command docker build --build-arg http_proxy=http://proxy:8080/ -t ImName .
I already checked #171 #191 #207 but didn't help.
Any solution?
The proxy URL must be escaped, as per @crts-xxx's comment. That fixed the problem for me.
Hi hit the same issue, I am trying to build a image from docker file
here is the content of docker build file :
curl.df
FROM gliderlabs/alpine:latest
LABEL source=dockerinaction
LABEL category=utility
RUN apk --update add curl
ENTRYPOINT ["curl"]
CMD ["--help"]
when I try to run the build command
~ docker build -t dockerinaction/curl -f curl.df .
[+] Building 3.7s (6/6) FINISHED
=> [internal] load build definition from curl.df 0.0s
=> => transferring dockerfile: 229B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/gliderlabs/alpine:latest 2.7s
=> [auth] gliderlabs/alpine:pull token for registry-1.docker.io 0.0s
=> CACHED [1/2] FROM docker.io/gliderlabs/alpine:latest@sha256:23b993692b943f0799b3f36042d8a1331557103eb4ac2c0b8ab36cab9f399f8b 0.0s
[2/2] RUN apk --update add curl:
6 0.251 fetch http://alpine.gliderlabs.com/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
executor failed running [/bin/sh -c apk --update add curl]: exit code: 1
~
Any suggestions?
Thanks very much
I still face the issue with alpine:3.9 behind a proxy.
echo "https://local_official_repo/alpine/v3.9/main" > /etc/apk/repositories && \
echo "https://local_official_repo/alpine/v3.9/community" >> /etc/apk/repositories && \
apk add --no-cache procps
I end up in DNS lookup error which fails with exit code: 1
As suggested in other tickets with respect to http_proxy and HTTP_PROXY_AUTH did not solve the problem.
Any suggestions or solutions !!
Try this temporarily.
dinghy up
eval $(dinghy env)
dinghy ssh
sudo su
dinghy_dns_ip=$(ip addr | grep "192.168" | awk '{print $2}' | cut -d/ -f1)
echo "{\"dns\": [\"$dinghy_dns_ip\",\"8.8.8.8\",\"1.1.1.1\"]}" > /etc/docker/daemon.json
exit && exit
dinghy restart
I am using a corporate proxy, without authentication.
When I try the build an image based on alpine, It gives me the bellow error when I try to install a package.fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/main: DNS lookup error fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/community: DNS lookup errorI build using the command
docker build --build-arg http_proxy=http://proxy:8080/ -t ImName .I already checked #171 #191 #207 but didn't help.
Any solution?
use image alpine:3.12, not use latest
Hello,
Actually, I managed to solve this using docker build --network=host -t myName .
So, when adding --network=host we will use the host newtork which is already using the proxy.
I'm closing this issue.
Most helpful comment
Hello,
Actually, I managed to solve this using
docker build --network=host -t myName .So, when adding
--network=hostwe will use the host newtork which is already using the proxy.I'm closing this issue.