Skip to content

Commit 463654e

Browse files
committed
fix(docker): set WORKDIR to root in loki Dockerfiles
The distroless static image has workdir set to /home/nonroot, owned by the user nonroot with uid of 65532 and permission of 700. Since the user is changed to loki with uid 1001, this can cause the startup of container to fail, as there is no permission to enter the workdir.
1 parent d6147d8 commit 463654e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

cmd/loki/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ COPY --from=filesystem /etc/passwd /etc/passwd
2626
COPY --from=filesystem /etc/group /etc/group
2727

2828
USER 10001
29+
WORKDIR /
2930
EXPOSE 3100
3031
ENTRYPOINT [ "/usr/bin/loki" ]
3132
CMD ["-config.file=/etc/loki/local-config.yaml"]

cmd/loki/Dockerfile.cross

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ COPY --from=filesystem /etc/passwd /etc/passwd
2828
COPY --from=filesystem /etc/group /etc/group
2929

3030
USER 10001
31+
WORKDIR /
3132
EXPOSE 3100
3233
ENTRYPOINT [ "/usr/bin/loki" ]
3334
CMD ["-config.file=/etc/loki/local-config.yaml"]

0 commit comments

Comments
 (0)