From 0e2a3e00f5b32d5407f4f929a1ae61d3df825362 Mon Sep 17 00:00:00 2001 From: frank-dspeed Date: Mon, 30 Sep 2024 01:55:04 +0000 Subject: [PATCH] examples/vm/rootless-docker.md aktualisiert (#487) Depending on the VM's existing users the id can vary Reviewed-on: https://gitea.com/gitea/act_runner/pulls/487 Reviewed-by: techknowlogick Reviewed-by: Lunny Xiao Co-authored-by: frank-dspeed Co-committed-by: frank-dspeed --- examples/vm/rootless-docker.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/vm/rootless-docker.md b/examples/vm/rootless-docker.md index 2f07d78..d3a6d59 100644 --- a/examples/vm/rootless-docker.md +++ b/examples/vm/rootless-docker.md @@ -11,7 +11,8 @@ As `root`: ```bash useradd -m rootless passwd rootless -``` + apt-get install -y uidmap # Not mentioned but needed for docker rootless. + ``` - Install [`docker-ce`](https://docs.docker.com/engine/install/) - (Recommended) Disable the system-wide Docker daemon @@ -21,12 +22,19 @@ As `root`: As the `rootless` user: - Follow the instructions for [enabling rootless mode](https://docs.docker.com/engine/security/rootless/) -- Add the following lines to the `/home/rootless/.bashrc`: +- Add the following line to the `/home/rootless/.bashrc`: ```bash - export XDG_RUNTIME_DIR=/home/rootless/.docker/run - export PATH=/home/rootless/bin:$PATH - export DOCKER_HOST=unix:///run/user/1001/docker.sock +for f in ./.bashrc.d/*.bash; do echo "Processing $f file..."; . "$f"; done +``` + +- Create the .bashrc.d directory `mkdir ~/.bashrc.d` +- Add the following lines to the `/home/rootless/.bashrc.d/rootless-docker.bash`: + +```bash +export XDG_RUNTIME_DIR=/home/rootless/.docker/run +export PATH=/home/rootless/bin:$PATH +export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock ``` - Reboot. Ensure that the Docker process is working.