Alpine Linux Repo URL Changed, Tutorial No Longer Working

The tutorial here: Deploy a Web Scraper using Puppeteer, Node.js and Docker on Koyeb - Koyeb was at one point accurate but as of lately the Alpine Linux repository URLs seem to be wrong.

I recently was not able to build my docker image. It kept failing on the apk update command.

In the Dockerfile the URLs have to be changed from:

  • http://nl.alpinelinux.org/alpine/edge/community
  • http://nl.alpinelinux.org/alpine/edge/main
    to:
  • https://dl-cdn.alpinelinux.org/alpine/edge/community
  • https://dl-cdn.alpinelinux.org/alpine/edge/main

Hi!

Thanks for that, nice catch. We will update the tutorial :slightly_smiling_face:

On the other hand, it still works for me because nl.alpinelinux.org redirects me to dl-cdn.alpinelinux.org. I am surprised that it breaks on your machine.

Do you mind sharing the errors logs that you have?

1 Like

Also maybe the output of docker --version would help. I’m intrigued :grin:

Hello @nicolas,

For me nl.alpinelinux.org does not redirect to dl-cdn.alpinelinux.org. And as for my Docker version, I recently updated to the latest.

Docker version 24.0.5, build ced0996

Also here is the output that contains the error when building using nl.alpinelinux.org.

[+] Building 2.5s (8/10)                                                                                                                                                                                                                                   docker:default
 => [internal] load .dockerignore                                                                                                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                      0.0s 
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                 0.0s 
 => => transferring dockerfile: 598B                                                                                                                                                                                                                                 0.0s 
 => [internal] load metadata for docker.io/library/node:lts-alpine                                                                                                                                                                                                   0.5s
 => [auth] library/node:pull token for registry-1.docker.io                                                                                                                                                                                                          0.0s
 => [1/5] FROM docker.io/library/node:lts-alpine@sha256:3482a20c97e401b56ac50ba8920cc7b5b2022bfc6aa7d4e4c231755770cf892f                                                                                                                                             0.0s
 => [internal] load build context                                                                                                                                                                                                                                    0.4s 
 => => transferring context: 449.31kB                                                                                                                                                                                                                                0.3s 
 => CACHED [2/5] WORKDIR /app                                                                                                                                                                                                                                        0.0s 
 => ERROR [3/5] RUN apk update && apk add --no-cache nmap &&     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories &&     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/main >> /etc/apk/repos  1.9s 
------
 > [3/5] RUN apk update && apk add --no-cache nmap &&     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories &&     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories &&     apk update &&     apk add --no-cache       chromium       harfbuzz       "freetype>2.8"       ttf-freefont       nss:
0.351 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
0.634 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
0.949 v3.18.3-149-g8225da85c11 [https://dl-cdn.alpinelinux.org/alpine/v3.18/main]
0.949 v3.18.3-153-gf7772e0bc84 [https://dl-cdn.alpinelinux.org/alpine/v3.18/community]
0.949 OK: 20063 distinct packages available
0.977 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
1.062 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
1.225 (1/5) Installing lua5.3-libs (5.3.6-r5)
1.238 (2/5) Installing libpcap (1.10.4-r1)
1.250 (3/5) Installing pcre (8.45-r3)
1.263 (4/5) Installing libssh2 (1.10.0-r4)
1.275 (5/5) Installing nmap (7.93-r1)
1.344 Executing busybox-1.36.1-r2.trigger
1.349 OK: 23 MiB in 22 packages
1.386 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
1.471 fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
1.587 fetch http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
1.736 fetch http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
1.736 WARNING: updating and opening http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/community: DNS lookup error
1.738 WARNING: updating and opening http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/main: DNS lookup error
1.808 v3.18.3-149-g8225da85c11 [https://dl-cdn.alpinelinux.org/alpine/v3.18/main]
1.808 v3.18.3-153-gf7772e0bc84 [https://dl-cdn.alpinelinux.org/alpine/v3.18/community]
1.808 4 unavailable, 0 stale; 20063 distinct packages available
------
Dockerfile:5
--------------------
   4 |
   5 | >>> RUN apk update && apk add --no-cache nmap && \
   6 | >>>     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \
   7 | >>>     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \
   8 | >>>     apk update && \
   9 | >>>     apk add --no-cache \
  10 | >>>       chromium \
  11 | >>>       harfbuzz \
  12 | >>>       "freetype>2.8" \
  13 | >>>       ttf-freefont \
  14 | >>>       nss
  15 |
--------------------
ERROR: failed to solve: process "/bin/sh -c apk update && apk add --no-cache nmap &&     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories &&     echo @edge http://nl.alpinelinux.org.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories &&     apk update &&     apk add --no-cache       chromium       harfbuzz       \"freetype>2.8\"       ttf-freefont       nss" did not complete successfully: exit code: 4

I do see that sometimes its using nl.alpinelinux.org and other times it has redirected to dl-cdn.alpinelinux.org. I also see a DNS lookup error in the logs.

I also did a DNS lookup on nl.alpinelinux.org and I do see that it has an A record and a CNAME. I’m currently using the Cloudflare DNS on my router (1.1.1.1 & 1.0.0.1) which also returns the correct records.

I’m not sure what the issue could be, I just know that when I switch to nl.alpinelinux.org I no longer have any issues.

Hey!

Sorry, I forgot to answer here. We updated the tutorial last week to target dl-cdn.aplinelinux.org, thanks again for the report :handshake:.

I think that the DNS error you had was because there was a typo in the Dockerfile: the URL was http://nl.alpinelinux.org.alpinelinux.org/... instead of http://nl.alpinelinux.org/...