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:
- docker run --rm filipegalo/alpine-bash bash -c 'curl -I http://google.pt/'
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.