Skip to content

Commit d5338f2

Browse files
committed
fix: run container as root, matching the rest of the fleet
Non-root USER made bind-mount ownership mismatches fatal, since an unprivileged process can't write into a directory it doesn't own. Root bypasses that check entirely (DAC_OVERRIDE), which is why this class of bug doesn't show up for other apps on the same host — they run as root by default too. Drops the now-unneeded mkdir+chown.
1 parent b6b107d commit d5338f2

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ COPY . .
66
RUN CGO_ENABLED=0 go build -o /out/readone .
77

88
FROM alpine:3.20
9-
RUN adduser -D -u 10001 readone
109
WORKDIR /app
1110
COPY --from=build /out/readone ./readone
12-
RUN mkdir -p /app/data && chown -R readone:readone /app/data
13-
USER readone
1411
ENV PORT=8080
1512
ENV DB_PATH=/app/data/data.db
1613
VOLUME ["/app/data"]

0 commit comments

Comments
 (0)