I’m running DockerFile installation and when come to the part of installation APKIndex.tar.gz,
# Add additional repo's for apk to use
RUN echo http://dl-cdn.alpinelinux.org/alpine/v3.3/main > /etc/apk/repositories; \
echo http://dl-cdn.alpinelinux.org/alpine/v3.3/community >> /etc/apk/repositories
I got error
RUN apk --update add wget tar bash coreutils procps openssl:
0.503 fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
5.507 ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.3/main: temporary error (try again later)
5.507 WARNING: Ignoring APKINDEX.5a59b88b.tar.gz: No such file or directory
5.507 fetch http://dl-cdn.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
10.51 ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.3/community: temporary error (try again later)
10.51 WARNING: Ignoring APKINDEX.7c1f02d6.tar.gz: No such file or directory
When I go to browser and go open the internet, everything is works fine. After I googled, I found the culprit because I’m using DNS 1.1.1.1
and 8.8.8.8
for my main network.
The solution is to add the default DNS into docker.
- First edit
sudo vim /etc/docker/daemon.json
- Add your default DNS or maybe open-dns
{
"dns": ["8.8.8.8", "8.8.4.4"]
}
3. Restart
sudo service docker restart