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
# 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- 
(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 '19 at 10:17
  • The permission errors (as shown in the first code block) appear. – Wilbert Mar 22 '19 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 '19 at 19:45

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.

| improve this answer | |

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.