Skip to content

Commit 29e3fe8

Browse files
authored
Docs: Badger file permission as non-root service (#5282)
## Which problem is this PR solving? - Related jaegertracing/documentation#683 ## Description of the changes - Badger file permission as non-root service ## How was this change tested? - No ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` Signed-off-by: tico88612 <[email protected]>
1 parent 55ceba9 commit 29e3fe8

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Badger file permissions as non-root service
2+
3+
After the release of 1.50, Jaeger's Docker image is no longer running with root privileges (in [#4783](https://github.com/jaegertracing/jaeger/pull/4783)). In some installations it may cause issues such as "permission denied" errors when writing data.
4+
5+
A possible workaround for this ([proposed here](https://github.com/jaegertracing/jaeger/issues/4906#issuecomment-1991779425)) is to run an initialization step as `root` that pre-creates the Badger data directory and updates its owner to the user that will run the main Jaeger process.
6+
7+
```yaml
8+
version: "3.9"
9+
10+
services:
11+
[...]
12+
jaeger:
13+
image: jaegertracing/all-in-one:latest
14+
command:
15+
- "--badger.ephemeral=false"
16+
- "--badger.directory-key=/badger/data/keys"
17+
- "--badger.directory-value=/badger/data/values"
18+
- "--badger.span-store-ttl=72h0m0s" # limit storage to 72hrs
19+
environment:
20+
- SPAN_STORAGE_TYPE=badger
21+
# Mount host directory "jaeger_badger_data" as "/badger" inside the container.
22+
# The actual data directory will be "/badger/data",
23+
# since we cannot change permissions on the mount.
24+
volumes:
25+
- jaeger_badger_data:/badger
26+
ports:
27+
- "16686:16686"
28+
- "14250"
29+
- "4317"
30+
depends_on:
31+
prepare-data-dir:
32+
condition: service_completed_successfully
33+
34+
prepare-data-dir:
35+
# Run this step as root so that we can change the directory owner.
36+
user: root
37+
image: jaegertracing/all-in-one:latest
38+
command: "/bin/sh -c 'mkdir -p /badger/data && touch /badger/data/.initialized && chown -R 10001:10001 /badger/data'"
39+
volumes:
40+
- jaeger_badger_data:/badger
41+
42+
volumes:
43+
jaeger_badger_data:
44+
```

0 commit comments

Comments
 (0)