1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

fix: run container as dfly user (#1775)

This commit is contained in:
Søren Hansen 2023-08-31 18:54:50 +02:00 committed by GitHub
parent 4350cf35d7
commit 7492550f12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View file

@ -42,4 +42,6 @@ ENTRYPOINT ["entrypoint.sh"]
EXPOSE 6379
USER dfly
CMD ["dragonfly", "--logtostderr"]

View file

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
from ghcr.io/romange/alpine-dev as builder
FROM ghcr.io/romange/alpine-dev as builder
WORKDIR /build
COPY src/ ./src/
@ -29,4 +29,7 @@ HEALTHCHECK CMD /usr/local/bin/healthcheck.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 6380
USER dfly
CMD ["dragonfly", "--logtostderr"]

View file

@ -53,4 +53,6 @@ ENTRYPOINT ["entrypoint.sh"]
# For inter-container communication.
EXPOSE 6379
USER dfly
CMD ["dragonfly", "--logtostderr"]

View file

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
from ghcr.io/romange/ubuntu-dev:20 as builder
FROM ghcr.io/romange/ubuntu-dev:20 as builder
ARG TARGETPLATFORM
@ -12,7 +12,6 @@ RUN curl -O https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c &&
RUN /tmp/fetch_release.sh ${TARGETPLATFORM}
# Now prod image
FROM ubuntu:20.04
@ -23,12 +22,12 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN apt clean && apt update && apt -y install netcat-openbsd ca-certificates redis-tools libxml2
RUN groupadd -r -g 999 dfly && useradd -r -g dfly -u 999 dfly
RUN mkdir /data && chown dfly:dfly /data
VOLUME /data
WORKDIR /data
COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY tools/docker/healthcheck.sh /usr/local/bin/healthcheck.sh
COPY --from=builder /build/su-exec /usr/local/bin/
@ -40,4 +39,6 @@ ENTRYPOINT ["entrypoint.sh"]
# For inter-container communication.
EXPOSE 6379
USER dfly
CMD ["dragonfly", "--logtostderr"]