Docker Community Forums

Share and learn in the Docker community.

Map more UID on rootless Docker and mount volume

Since the rootless mode reached general availability, I am trying it out.
I have a problem, though.

When I mount my working directory with docker-compose, the UID mapper works fine.
Every file created with UID 0 (root) inside the container got mapped to my user on the host system.

However, when I create a file with a user other than root inside the container, the file owner will be set to a UID without a user on the host system. And now we are back to square one, with the same permission related issues.

Can I map more UIDs apart from 0 to my user on the host system?
If not, how do you deal with the mounted file permission during the application development?

The installation script is available at https://get.docker.com/rootless.

$ curl -fsSL https://get.docker.com/rootless | sh
Make sure to run the script as a non-root user. To install Rootless Docker as the root user, see the Manual installation steps.

The script shows environment variables that are required:

$ curl -fsSL https://get.docker.com/rootless | sh

Docker binaries are installed in /home/testuser/bin

WARN: dockerd is not in your current PATH or pointing to /home/testuser/bin/dockerd

Make sure the following environment variables are set (or add them to ~/.bashrc):

export PATH=/home/testuser/bin:$PATH
export PATH=$PATH:/sbin
export DOCKER_HOST=unix:///run/user/1001/docker.sock

To control docker service run:

systemctl --user (start|stop|restart) docker

Manual installation
To install the binaries manually without using the installer, extract docker-rootless-extras-.tgz along with docker-.tgz from https://download.docker.com/linux/static/stable/x86_64/

If you already have the Docker daemon running as the root, you only need to extract docker-rootless-extras-.tgz. The archive can be extracted under an arbitrary directory listed in the $PATH. For example, /usr/local/bin, or $HOME/bin.

Not sure how it related to the question.
Are you a human or a spamming bot?

AFAIK lewis95 is a bot, so the context of questions is often misinterpreted.