While running a simple docker build
in CoreOS I am unable to install any packages. As seen below it won’t accept install commands and throws permission denied.
If I run docker run --privileged -it alpine bash
I can update and install whatever I like. It seems that the privileged flag is required here for the DockerFile as well, except you can’t do that.
Anyone know of way to set privileged for the docker build command?
FROM alpine:latest
RUN apk update
# Add needed directories
RUN mkdir -p /app /var/log/supervisor
# Add needed packages
RUN apk add --no-cache supervisor rsync
# Copy out config files
COPY supervisord.conf /app/supervisord.conf
# Add aplications to the supervisord.conf
ENTRYPOINT ["supervisord", "-n", "-c", "/app/supervisord.conf"]
The followin error is seen…
> docker rmi cron; docker build -t cron .
Error: No such image: cron
[+] Building 0.9s (8/9)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 441B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 0.0s
=> [1/5] FROM docker.io/library/alpine:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 97B 0.0s
=> CACHED [2/5] RUN apk update 0.0s
=> CACHED [3/5] RUN mkdir -p /app /var/log/supervisor 0.0s
=> ERROR [4/5] RUN apk add --no-cache supervisor rsync 0.8s
------
> [4/5] RUN apk add --no-cache supervisor rsync:
#7 0.794 exec /bin/sh: permission denied
------
executor failed running [/bin/sh -c apk add --no-cache supervisor rsync]: exit code: 1
EDIT: Maybe this needs a bug report. I am thinking security is too heavy here and they (RHEL) in essence broke docker.