How to mount a volume writable by a non-root user? I am fine with a volume owned by a non-root user, or with permissions set to 777.
Dockerfile:
FROM alpine RUN adduser -D myuser USER myuser
Assembly image:
docker build -t example .
Run image, see / application that cannot be written by user
% docker run -i -t -v myapp:/app example /bin/sh / $ whoami myuser / $ ls -lha / | grep app drwxr-xr-x 2 root root 4.0K Nov 12 21:01 app / $
We see that the application is readable globally, but only writable by root.
source share