Solve alpine APKINDEX.tar.gz no such file temporary error

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 > /etc/apk/repositories; \
    echo >> /etc/apk/repositories

I got error

RUN apk --update add wget tar bash coreutils procps openssl:                                                          
0.503 fetch                                                      
5.507 ERROR: temporary error (try again later)                                         
5.507 WARNING: Ignoring APKINDEX.5a59b88b.tar.gz: No such file or directory                                                            
5.507 fetch                                                 
10.51 ERROR: 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 and for my main network.

The solution is to add the default DNS into docker.

  1. First edit sudo vim /etc/docker/daemon.json
  2. Add your default DNS or maybe open-dns
  "dns": ["", ""]

3. Restart

sudo service docker restart

Leave a Reply

Your email address will not be published. Required fields are marked *