0

While I'm trying to build a new image from a Dockerfile:


FROM alpine:latest

USER root

ENV JAVA_ALPINE_VERSION 8.151.12-r0

RUN apk update && apk upgrade
RUN apk add --no-cache openjdk8="$JAVA_ALPINE_VERSION" curl
RUN rm -rf /var/cache/apk/* && rm /usr/bin/java

ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV LANG C.UTF-8
ENV PATH $PATH:$JAVA_HOME/bin


WORKDIR /tmp

CMD ["sh"]

I'm getting the error:

ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/main: DNS lookup error WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/main: No such file or directory

The strange thing is: I have internet access from the machine (linux). I can CURL or ping the outside. I have built an image to test the internet access inside the container:

And I'm able to reach the outside.

Only while I'm trying to update the packages is where I'm getting the error.

Did anyone face the same issue?

Thank you.

  • I don't believe 3.14 has 8.151.12-r0 to begin with, see [here](https://pkgs.alpinelinux.org/packages?name=openjdk8&branch=v3.14) – jabbson Jul 03 '21 at 00:14
  • I assume `docker run --rm -it alpine:latest nslookup dl-cdn.alpinelinux.org` also doesn't resolve? – jabbson Jul 03 '21 at 00:34
  • Hello @jabbson, yes `** server can't find dl-cdn.alpinelinux.org: NXDOMAIN ` – Filipe Galo Jul 05 '21 at 10:41
  • But while I run docker run --rm filipegalo/alpine-bash bash -c 'http_proxy=http://xxxx:xxxx curl -I http://dl-cdn.alpinelinux.org' I'm getting an 200. Also while running the RUN apk update && apk upgrade with proxy also I'm not able to resolve the DNS. – Filipe Galo Jul 05 '21 at 10:46
  • docker run --rm filipegalo/alpine-bash bash -c 'http_proxy=http://xxxx:xxxx curl -I https://dl-cdn.alpinelinux.org' curl: (6) Could not resolve host: dl-cdn.alpinelinux.org docker run --rm filipegalo/alpine-bash bash -c 'http_proxy=http://xxxx:xxxx curl -I http://dl-cdn.alpinelinux.org' 0HTTP/1.1 200 OK – Filipe Galo Jul 05 '21 at 10:58
  • I figured out the problem I was using an http proxy while reaching https. Changing http_proxy to https_proxy solved. – Filipe Galo Jul 05 '21 at 11:04

0 Answers0