mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
98b92a0073
- make use of docker buildx caching when possible (helpful with local docker builds) - introduce a reusable container workflow which is triggered by docker-release and docker-weekly workflows - added an alpine-dev Dockerfile - split release.sh contents into different Makefile targets - make use of job matrix to build alpine + ubuntu in parallel - make alpine build optional by checking for Dockerfile presence -- as the pre-built binaries don't work with alpine, because of glibc <-> musl incompatibilities Signed-off-by: Philipp Born <git@pborn.eu>
43 lines
1.1 KiB
Text
43 lines
1.1 KiB
Text
# syntax=docker/dockerfile:1
|
|
from ghcr.io/romange/ubuntu-dev:20 as builder
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
WORKDIR /build
|
|
COPY tools/docker/fetch_release.sh /tmp/
|
|
COPY releases/dragonfly-* /tmp/
|
|
|
|
RUN curl -O https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c && \
|
|
gcc -Wall -O2 su-exec.c -o su-exec
|
|
|
|
RUN /tmp/fetch_release.sh ${TARGETPLATFORM}
|
|
|
|
|
|
# Now prod image
|
|
FROM ubuntu:20.04
|
|
|
|
# ARG in fact change the env vars during the build process
|
|
# ENV persist the env vars for the built image as well.
|
|
ARG QEMU_CPU
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt clean && apt update && apt -y install netcat-openbsd
|
|
|
|
|
|
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/
|
|
COPY --from=builder /build/dragonfly /usr/local/bin/
|
|
|
|
HEALTHCHECK CMD /usr/local/bin/healthcheck.sh
|
|
ENTRYPOINT ["entrypoint.sh"]
|
|
|
|
# For inter-container communication.
|
|
EXPOSE 6379
|
|
|
|
CMD ["dragonfly", "--logtostderr"]
|