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 <techknowlogick@noreply.gitea.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: frank-dspeed <frank-dspeed@noreply.gitea.com> Co-committed-by: frank-dspeed <frank-dspeed@noreply.gitea.com>
This commit is contained in:
parent
b282356e9e
commit
0e2a3e00f5
1 changed files with 13 additions and 5 deletions
|
@ -11,6 +11,7 @@ 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/)
|
||||
|
@ -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
|
||||
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/1001/docker.sock
|
||||
export DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock
|
||||
```
|
||||
|
||||
- Reboot. Ensure that the Docker process is working.
|
||||
|
|
Loading…
Reference in a new issue