1

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?

  • I just did a docker build from your Dockerfile, it was successful. What happens when you docker build it? – ctrl-alt-delor Mar 22 at 10:17
  • The permission errors (as shown in the first code block) appear. – Wilbert Mar 22 at 10:48
  • I removed docker from title, as I don't think it is relevant. Can you accept your answer by clicking the tick ✓. – ctrl-alt-delor Mar 22 at 19:45
1

Blocked by Proxy

Turns out the problem was that our Proxy did not allow downloads from dl-cdn.alpinelinux.org.

The error message that alpine gives could be clearer, but anyway: Allowing downloads from that URL made the apk add run through without problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.