konstruktoid/ansible-role-docker-rootless

Error accessing mounted directories using a non-root container user.

Utkarsh-vishnoi opened this issue · 1 comments

Hi @konstruktoid,

I am trying to run an instance of step-ca. As per the Dockerfile of this image the process inside the container is run as the step user which is not the root user. Since my docker imstallation is rootless, The step user inside the container doesn't have write access to the mounted volumes. This issue exists with other images as well where the process inside the container is not run as root.

I also verified that the host directory that is mounted on the container is owned by the dockeruser which is running the docker daemon as rootless.

I saw few articles online that maps the user id from host user to container user but so far I couldn't get it to work.
Could you please provide your 2 cents and assist on what I could be doing wrong?

Thanks & Regards,

Utkarsh Vishnoi

@Utkarsh-vishnoi, I haven't had the time to test yet, but have you tried setting a user using --user=""
(https://docs.docker.com/engine/reference/run/#user)?