Cannot build my docker file on Fedora, apk add says : "BAD signature"
Hi,
Here's my dockerFile :
# cat dockerImages/sebM_MiniLinux
FROM docker.io/alpine:latest
RUN apk update -q
RUN apk add bash
ENTRYPOINT ["bash"]
Can't build my docker file on Fedora, apk add says : "BAD signature" :
# docker build -t sebm/alpine -f dockerImages/sebM_MiniLinux dockerImages/
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM docker.io/alpine:latest
---> 389fef711851
Step 2/4 : RUN apk update -q
---> Using cache
---> e831e51bb70a
Step 3/4 : RUN apk add bash
---> Running in b58aa08893aa
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/4) Installing ncurses-terminfo-base (6.2_p20200523-r0)
ERROR: ncurses-terminfo-base-6.2_p20200523-r0: BAD signature
(2/4) Installing ncurses-libs (6.2_p20200523-r0)
(3/4) Installing readline (8.0.4-r0)
ERROR: ncurses-libs-6.2_p20200523-r0: BAD signature
(4/4) Installing bash (5.0.17-r0)
ERROR: bash-5.0.17-r0: BAD signature
3 errors; 6 MiB in 15 packages
The command '/bin/sh -c apk add bash' returned a non-zero code: 3
# echo $?
3
I'm using docker v20.10.1.
Can you please help me ?
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Seb M mentioned in issue alpine/infra/infra#10705 (closed)
mentioned in issue alpine/infra/infra#10705 (closed)
- Seb M changed the description
changed the description
- Guest
Can’t you just use
FROM alpine:latest
Also
apk add --no-cache --upgrade bash
Which does not need the update before it and upgrades needed packages also. OK, here's the docker file now :
# cat dockerImages/sebM_alpine FROM alpine:latest # RUN apk update -q RUN apk add --no-cache --upgrade bash ENTRYPOINT ["bash"]
Unfortunatly, it does not solve the pb. :
# docker build -t sebm/alpine -f dockerImages/sebM_alpine dockerImages/ Sending build context to Docker daemon 3.072kB Step 1/3 : FROM alpine:latest ---> 389fef711851 Step 2/3 : RUN apk add --no-cache --upgrade bash ---> Running in 235087488e0c fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz (1/4) Installing ncurses-terminfo-base (6.2_p20200523-r0) ERROR: ncurses-terminfo-base-6.2_p20200523-r0: BAD signature (2/4) Installing ncurses-libs (6.2_p20200523-r0) (3/4) Installing readline (8.0.4-r0) (4/4) Installing bash (5.0.17-r0) ERROR: readline-8.0.4-r0: BAD signature Executing bash-5.0.17-r0.post-install Executing busybox-1.31.1-r19.trigger 2 errors; 7 MiB in 16 packages The command '/bin/sh -c apk add --no-cache --upgrade bash' returned a non-zero code: 2 #
and I don't always get the same number of BAD signature errors :
# docker build -t sebm/alpine -f dockerImages/sebM_alpine dockerImages/ Sending build context to Docker daemon 4.096kB Step 1/3 : FROM alpine:latest ---> 389fef711851 Step 2/3 : RUN apk add --no-cache --upgrade bash ---> Running in cef1bcf184b5 fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz (1/4) Installing ncurses-terminfo-base (6.2_p20200523-r0) (2/4) Installing ncurses-libs (6.2_p20200523-r0) ERROR: ncurses-terminfo-base-6.2_p20200523-r0: BAD signature (3/4) Installing readline (8.0.4-r0) ERROR: ncurses-libs-6.2_p20200523-r0: BAD signature ERROR: Failed to create usr/lib/libreadline.so.8.0: No error information ERROR: readline-8.0.4-r0: BAD signature (4/4) Installing bash (5.0.17-r0) ERROR: bash-5.0.17-r0: BAD signature 4 errors; 6 MiB in 14 packages The command '/bin/sh -c apk add --no-cache --upgrade bash' returned a non-zero code: 4
Edited by Seb M- Guest
It works on arm64, could be a network problem?
Have you tried:
FROM alpine:3.12
Or
FROM alpine:3.11
@a16bitsysop Same pb. with
alpine:3.12
oralpine:3.11
BTW. : Given that bash is not installed by default in the basic alpine image, is the
--upgrade
option necessary ?- Guest
It is in case busybox or musl has been upgraded since Docker image.
Have you tried starting a shell inside an alpine Linux container and doing commands manually?
@a16bitsysop Same pb. :
# docker run -ti --rm alpine / # apk add bash fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz (1/4) Installing ncurses-terminfo-base (6.2_p20200523-r0) ERROR: ncurses-terminfo-base-6.2_p20200523-r0: BAD signature (2/4) Installing ncurses-libs (6.2_p20200523-r0) (3/4) Installing readline (8.0.4-r0) ERROR: readline-8.0.4-r0: BAD signature (4/4) Installing bash (5.0.17-r0) ERROR: bash-5.0.17-r0: BAD signature 3 errors; 6 MiB in 15 packages
Edited by Seb M- Guest
try and add --allow-untrusted
@a16bitsysop Still the same :
# docker build -t sebm/alpine -f dockerImages/sebM_alpine dockerImages/ Sending build context to Docker daemon 4.096kB Step 1/3 : FROM alpine:3.12 ---> 389fef711851 Step 2/3 : RUN apk add --allow-untrusted --no-cache --upgrade bash ---> Running in cb85ac52d5ac fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz (1/4) Installing ncurses-terminfo-base (6.2_p20200523-r0) ERROR: ncurses-terminfo-base-6.2_p20200523-r0: BAD signature (2/4) Installing ncurses-libs (6.2_p20200523-r0) (3/4) Installing readline (8.0.4-r0) ERROR: ncurses-libs-6.2_p20200523-r0: BAD signature (4/4) Installing bash (5.0.17-r0) ERROR: readline-8.0.4-r0: BAD signature ERROR: bash-5.0.17-r0: BAD signature 4 errors; 6 MiB in 14 packages The command '/bin/sh -c apk add --allow-untrusted --no-cache --upgrade bash' returned a non-zero code: 4
- Guest
Try and edit
/etc/apk/repositories
so it points to a mirror Eg for edge, or change edge to 3.12 for stable:https://uk.alpinelinux.org/alpine/edge/main https://uk.alpinelinux.org/alpine/edge/community
@a16bitsysop It works now thanks, it seems there was something wrong reaching
dl-cdn.alpinelinux.org
but pointing the main repo. touk.alpinelinux.org
:# docker build -t sebm/alpine -f dockerImages/sebM_alpine dockerImages/ Sending build context to Docker daemon 4.096kB Step 1/3 : FROM alpine:3.12 3.12: Pulling from library/alpine 801bfaa63ef2: Pull complete Digest: sha256:3c7497bf0c7af93428242d6176e8f7905f2201d8fc5861f45be7a346b5f23436 Status: Downloaded newer image for alpine:3.12 ---> 389fef711851 Step 2/3 : RUN apk add --repository http://uk.alpinelinux.org/alpine/v3.12/main bash ---> Running in 943324ce40c2 fetch http://uk.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz (1/4) Installing ncurses-terminfo-base (6.2_p20200523-r0) (2/4) Installing ncurses-libs (6.2_p20200523-r0) (3/4) Installing readline (8.0.4-r0) (4/4) Installing bash (5.0.17-r0) Executing bash-5.0.17-r0.post-install Executing busybox-1.31.1-r19.trigger OK: 8 MiB in 18 packages Removing intermediate container 943324ce40c2 ---> 768b623527ba Step 3/3 : ENTRYPOINT ["bash"] ---> Running in 8b7eaf9334fe Removing intermediate container 8b7eaf9334fe ---> 24cde25b8b11 Successfully built 24cde25b8b11 Successfully tagged sebm/alpine:latest
Do I always have to point to
uk.alpinelinux.org
manually in my docker files, or is there another solution ?- Guest
It should work without choosing a mirror, maybe try it over a few days and see if it stops?
- Guest
You could try a
traceroute
todl-cdn.alpinelinux.org
as well @a16bitsysop Good idea :
# traceroute --max-hops=64 dl-cdn.alpinelinux.org traceroute to dl-cdn.alpinelinux.org (151.101.122.133), 30 hops max, 60 byte packets 1 gateway (192.168.23.200) 0.486 ms 0.898 ms 1.019 ms 2 192.168.28.247 (192.168.28.247) 0.390 ms 0.339 ms 0.290 ms 3 192.168.41.200 (192.168.41.200) 0.363 ms 0.484 ms 0.432 ms 4 * * * 5 * * * 6 * * * 7 * * * 8 * * * 9 * * * 10 * * * 11 * * * 12 * * * 13 * * * 14 * * * 15 * * * 16 * * * 17 * * * 18 * * * 19 * * * 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * * 30 * * * 31 192.168.28.247 (192.168.28.247) 0.203 ms !X 0.166 ms !X 0.340 ms !X #
and the treceroute to
uk.alpinelinux.org
also has the same number of hops :# traceroute --max-hops=64 uk.alpinelinux.org traceroute to uk.alpinelinux.org (147.75.101.119), 30 hops max, 60 byte packets 1 gateway (192.168.23.200) 0.496 ms 0.927 ms 1.073 ms 2 192.168.28.247 (192.168.28.247) 0.390 ms 0.341 ms 0.300 ms 3 192.168.41.200 (192.168.41.200) 0.409 ms 0.542 ms 0.464 ms 4 * * * 5 * * * 6 * * * 7 * * * 8 * * * 9 * * * 10 * * * 11 * * * 12 * * * 13 * * * 14 * * * 15 * * * 16 * * * 17 * * * 18 * * * 19 * * * 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * * 30 * * * 31 192.168.28.247 (192.168.28.247) 0.335 ms !X 0.305 ms !X 0.256 ms !X #
Strange results.
Edited by Seb M- Guest
That is strange
- Owner
This kind of errors often happend due to some network problem.
Can you try use https mirrors instead of http?
sed -i -e 's/http:/https:/' /etc/apk/repositories
- Guest
How about having a mirror repo that redirects to closest in mirror list when installing? The ftpmirror.gnu.org address works like that with dns/http redirects somehow.
Collapse replies @a16bitsysop I don't know how to do that yet. Can you give a little more instructions ?