ERROR: unable to select packages: docker (no such package): required by: world[docker]

48 Views Asked by At

I'm trying to build a jenkins image and here's the dockerfile:

FROM "jenkins/jenkins:lts-alpine"

USER root
RUN apk add --no-cache docker
RUN apk add --no-cache nodejs
COPY ./run-zap.sh /home/run-zap.sh

before I enable the ufw(debian firewall), I run docker build . and it worked as expected.

but when I enabled the ufw with the rules below :

sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
22/tcp                     ALLOW       142.2.0.0
22/tcp                     ALLOW       66.12.21.74
10443/tcp                  ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
10443/tcp (v6)             ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)

and then I run the docker build . command I got this error :

=> ERROR [2/4] RUN apk add --no-cache docker 122.4s

 > [2/4] RUN apk add --no-cache docker:
0.830 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
60.91 WARNING: fetching https://dl-cdn.alpinelinux.org/alpine/v3.19/main: Permission denied
60.91 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
121.0 WARNING: fetching https://dl-cdn.alpinelinux.org/alpine/v3.19/community: Permission denied
121.0 ERROR: unable to select packages:
121.0   docker (no such package):
121.0     required by: world[docker]

is it because of the ufw or something else . could you help please ?

thanks

0

There are 0 best solutions below