Skip to content

Commit 044eeef

Browse files
authored
Merge pull request #85 from Leprekus/docs/volume-permissions-fix
docs: explain volume permissions and UID 10001 requirements
2 parents b1e2218 + ec5adfe commit 044eeef

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

docs/installation/docker/index.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This article is based on RustFS official Linux binary packages, packaging RustFS
2323

2424
* Define listening port, admin account, data path, etc. in host `/etc/rustfs/config.toml` (see Section 4 for details)
2525

26-
4. RustFS container run as non-root user `rustfs` with id `10001`, if you run docker with `-v` to mount host directory into docker container, please make sure the owner of host directory has been changed to `10001`, otherwise you will encounter permission denied error.
26+
4. RustFS container run as non-root user `rustfs` with id `10001`, if you run docker with `-v` to mount host directory into docker container, please make sure the owner of host directory has been changed to `10001`, otherwise you will encounter permission denied error. You can run `chown -R 10001:10001 /path/to/host_directory` to grant the necessary permissions.
2727

2828
---
2929

@@ -175,6 +175,26 @@ Running the command under root directory,
175175
docker compose --profile observability up -d
176176
```
177177

178+
Providing the necessary permissions. An initialization container is necessary to grant the correct access rights to rustfs using the `depends_on` keyword. In the example below the `rustfs_perms` service is added to the `docker-compose.yml` to handle this.
179+
180+
```
181+
services:
182+
# grant the necessary permissions to RUSTFS volumes path
183+
rustfs_perms:
184+
image: alpine
185+
user: root
186+
volumes:
187+
- /path/to/host_directory/volumes:/fix_path
188+
command: chown -R 10001:10001 /fix_path
189+
190+
rustfs:
191+
image: rustfs/rustfs:latest
192+
depends_on:
193+
rustfs_perms:
194+
condition: service_completed_successfully
195+
# ... other configurations
196+
```
197+
178198
Started containers is as below,
179199

180200
```

0 commit comments

Comments
 (0)