2022-12-23 17:48:15 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
2023-09-18 11:41:40 +00:00
|
|
|
FROM ghcr.io/romange/ubuntu-dev:20 as builder
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
COPY . ./
|
|
|
|
|
2024-01-14 15:31:59 +00:00
|
|
|
RUN make release
|
2022-12-23 17:48:15 +00:00
|
|
|
|
2024-01-14 15:31:59 +00:00
|
|
|
RUN build-release/dragonfly --version
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
RUN curl -O https://raw.githubusercontent.com/ncopa/su-exec/212b75144bbc06722fbd7661f651390dc47a43d1/su-exec.c && \
|
2023-09-18 11:41:40 +00:00
|
|
|
gcc -Wall -O2 su-exec.c -o su-exec
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
FROM ubuntu:20.04
|
|
|
|
|
2023-09-18 11:41:40 +00:00
|
|
|
RUN --mount=type=tmpfs,target=/var/cache/apt \
|
|
|
|
--mount=type=tmpfs,target=/var/lib/apt/lists \
|
|
|
|
apt update && \
|
2024-03-04 10:47:18 +00:00
|
|
|
apt install -q -y --no-install-recommends netcat-openbsd ca-certificates redis-tools net-tools
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
RUN groupadd -r -g 999 dfly && useradd -r -g dfly -u 999 dfly
|
|
|
|
RUN mkdir /data && chown dfly:dfly /data
|
|
|
|
|
|
|
|
VOLUME /data
|
|
|
|
WORKDIR /data
|
2023-09-18 11:41:40 +00:00
|
|
|
|
2022-12-23 17:48:15 +00:00
|
|
|
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/
|
2024-01-14 15:31:59 +00:00
|
|
|
COPY --from=builder /build/build-release/dragonfly /usr/local/bin/
|
2022-12-23 17:48:15 +00:00
|
|
|
|
|
|
|
HEALTHCHECK CMD /usr/local/bin/healthcheck.sh
|
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|
|
|
|
|
|
|
|
# For inter-container communication.
|
|
|
|
EXPOSE 6379
|
|
|
|
|
2023-08-31 16:54:50 +00:00
|
|
|
USER dfly
|
|
|
|
|
2022-12-23 17:48:15 +00:00
|
|
|
CMD ["dragonfly", "--logtostderr"]
|