docker-alpine: dl-cdn.alpinelinux.org errors
$ apk add --no-cache bash
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/6) Installing pkgconf (1.3.10-r0)
(2/6) Installing ncurses-terminfo-base (6.0_p20171125-r0)
(3/6) Installing ncurses-terminfo (6.0_p20171125-r0)
ERROR: ncurses-terminfo-6.0_p20171125-r0: Protocol error
(4/6) Installing ncurses-libs (6.0_p20171125-r0)
(5/6) Installing readline (7.0.003-r0)
(6/6) Installing bash (4.4.19-r1)
ERROR: bash-4.4.19-r1: Protocol error
Executing busybox-1.27.2-r7.trigger
2 errors; 5 MiB in 15 packages
Been getting this for a few days now.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 63
- Comments: 82
adding
RUN echo -e "http://nl.alpinelinux.org/alpine/v3.5/main\nhttp://nl.alpinelinux.org/alpine/v3.5/community" > /etc/apk/repositoriesfixed my issue+1
Had this issue, but realized that it was a defective docker bridge or something. Restarting the daemon fixed it for me and the troubleshooting process was working back from DNS resolution, routing, etc from the pertinent host.
It’s DNS issue you can solve it by using the following steps:
IP4.DNS[1]: 192.168.0.1 <your-dns-ip-maybe-different>
deamon.jsonand file has below data: { “dns”: [“192.168.0.1”, “8.8.8.8”] }note: replace that ip “192.168.0.1” to your dns ip
Go that directory
/etc/docker/in your system and paste filedeamon.jsonthat you just createdThen restart your docker/your system, it will solve your issue.
In my case installing the latest libseccomp on my host fixed it. I had to download it manually on my latest raspbian as the latest version is not yet in the apt repos. The accepted answer in this “askubuntu” thread helped me: https://askubuntu.com/questions/1263284/apt-update-throws-signature-error-in-ubuntu-20-04-container-on-arm
Packages for debian(-based): https://packages.debian.org/sid/libseccomp2
Just download the one that fits your architecture and install with dpkg (again: only debian based). Example for raspbian:
wget http://ftp.de.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.debsudo dpkg -i libseccomp2_2.5.1-1_armhf.debfetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/main: temporary error (try again later) WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file or directory
CDN seems to be down again
as pointed out by @azyata its can be a problem with the
DNSsettingsIf you are performing
apk addinside the container, below might be helpfulFrom
docs.docker.com:if it doesn’t work
/etc/resolve.confin host machine, try addingthen perform ping
if it works for you, then
^ This solved the problem for me.
@prawen
RUN echo -e "http://nl.alpinelinux.org/alpine/v3.5/main\nhttp://nl.alpinelinux.org/alpine/v3.5/community" > /etc/apk/repositoriesfixed my issue before your $ apk add --no-cache bash
Also getting these errors.
In the above case, obtaining via CDN was resolved by using the ‘–network=host’ option at build time.
I got the above “
unsatisfiable constraints” IO ERROR WARNING but I was able tocurl(download) them from the host.So I assumed that CDN wasn’t down but something wrong about docker’s network. I set the network as
hostby--network=hostoption and started to download. Hope this helps.Raspbian-user here. totally fixed it for me!
Not working for me any updates on this ,
This is annoying
Fixed with setting the network to host: docker build . --network=host
Just posting here in case somebody else lands here trough google and all of the above did not fix their problem.
On my raspberry Pi with docker i ran into the same issue yesterday:
RUN apk add --no-cache acl fcgi file gettext git;Results in:
My search eventually landed me on:
docker-library/php#1118
From which i took away two things:
Downgrading from alpine3.13 to alpine3.12 solved it for me.
Had the same error trying to build an alpine-sdk docker using Docker Windows 10. Checked the status of the server, and the server was fine and reachable outside docker.
Restarting docker did the trick for me. Looking in the Docker log file it’s clear that the DNS configuration was set incorrectly. So when seeing this error in a docker context, try to restart docker first.
I tried most of the previous tips; however, only this one work for me.
docker network ls
output … a81de1c029c9 host host local
docker image build … --network=host .
I am also getting below error:
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz: IO ERROR fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz: IO ERROR
Replacing
httptohttpsin/etc/apk/repositoriesfix this issue for meThis solved my problem to build my docker image. Thank you
Adding --network=host in the build command fixed my issue.
In my situation was wrong
/etc/resolv.conffile. Just check in a containerping dl-cdn.alpinelinux.orgwesome, you are the most correct answer! Thank you very much. I applaud you.
Dirty hack for resolving this without changing daemon settings:
Notice that it only affect current layer, in other layers you should add this patch too if needed.
Also you can pass custom DNS server from the ARGs.
I’m behind a proxy and I experienced a similar error:
I solved it by creating a
daemon.jsonfile in/etc/docker/and inserting:
Restart docker and try again:
If I were to guess I’d say that docker bridge0 clash with the proxy in some way?
I had a similar issue, but I have solved it by using args --network=host eg. docker build --network=host -t myimage .
Have been using just
alpineand obviously it picks the latest version, in my case, it was v3.15.Downgrading to
alpine:3.12worked.had the same problem and with alpine 3.12 it works.
I found a few different solutions for this issue on CentOS8 from: https://stackoverflow.com/a/64240450/2971264
firewall-cmd --zone=public --add-masquerade --permanentfirewall-cmd --reloadWorks
and so does changing the folling parameter in the conf file
/etc/firewalld/firewalld.confto:FirewallBackend=iptablesand then so
sudo service firewalld restartI found that my corporate firewall wouldn’t allow me to download via HTTP. Looking at https://mirrors.alpinelinux.org/ I found https://alpine.global.ssl.fastly.net/alpine to be my closest mirror. I replaced the default repositories by adding
RUN echo -e "https://alpine.global.ssl.fastly.net/alpine/v3.11/main\nhttps://alpine.global.ssl.fastly.net/alpine/v3.11/community\n" > /etc/apk/repositoriesto switch to a mirror that supported HTTPS.
This works for me
RUN sed -i 's/dl-cdn/nl/' /etc/apk/repositoriesI believe this happens when MTU in the container differs from the MTU on the host. What happens is that Fastly filters out need-to-frag ICMP packets so Path MTU is broken on fastly (and dl-cdn.alpinelinux.org).
same issue on alpine:3.14 and alpine:3.13 Downgrading to alpine:3.12 is working back again for me. Using macOS, tried restarting Daemon and all other solutions here, only downgrading is working for me
docker build -t sample --network=host . working for me, thank you very much
Here are lots of smart solutions to test. But, as an initial try, please just restart the daemon first. It worked for me. sudo systemctl restart docker.service
Guess you got docker dns issue
it is ok thinks
Just rebooted my Ubuntu and it solved this issue.
Had the same problem with php 7.4 alpine image in Ubuntu inside Windows (WSL2). I was trying to install the imagick extension via pecl and kept getting “No releases available for package pecl.php.net/imagick” error. Changing the nameserver to google’s 8.8.8.8 solved it for me. Thank you.
I had disabled firewalld with no joy. I restarted docker and the issue was fixed.
This is wild. Repos constantly just break and anytime you have a new vm you need to troubleshoot all of this over again?
Solved with this solution. Thanks!!!
https://docs.docker.com/network/bridge/
update my server DNS to Google DNS 8.8.8.8 8.8.4.4 solve this for me
I had the same issue. I solved by putting proxy inside docker cointainer.
docker exec -it reports sh export http_proxy=http://ipaddress:port/ export https_proxy=http://ipaddress:port/ apk add --update ttf-dejavu
It downloaded required library with 200 OK exit status
Please use docker run -e OR docker build --build-arg to pass http_proxy env variable required for apk package manager
Seems your docker can not go out of host machine. Maybe this can help:
iptables -t nat -A POSTROUTING ! -o docker0 -s 172.17.0.0/16 -j MASQUERADE