I'm trying to install packages in a docker image based on alpine. The host system is CentOS system, system-release: CentOS Linux release 7.6.1810 (Core).
Here's what I do:
# docker run -td alpine:3.9
abbd2da62ed51047de063ef06e2422ae22ff77788fd70a626ad3a6b85856a3af.
# docker exec -it abbd2
/ # apk add bash
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-
cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ncurses-terminfo-base (6.1_p20190105-r0)
(2/5) Installing ncurses-terminfo (6.1_p20190105-r0)
(3/5) Installing ncurses-libs (6.1_p20190105-r0)
(4/5) Installing readline (7.0.003-r1)
ERROR: readline-7.0.003-r1: Permission denied
(5/5) Installing bash (4.4.19-r1)
ERROR: bash-4.4.19-r1: Permission denied
2 errors; 13 MiB in 17 packages
This corresponds to a Dockerfile like this:
FROM alpine:3.9
RUN apk add bash
Why do I get permission errors while trying to install the package (using bash here as an example)?
How can I get the package to install?