dragonfly/tools/packaging/Dockerfile.alpine-dev
Roman Gershman 904775cfe6
chore: new docker build pipeline (#4503)
Our previous weekly pipeline used qemu, was very slow and over-complicated.
This one uses matrix with proper parallelization and the latest arm64 github runners.

now it takes less than 30 minutes to build everything.
lets make it daily.
2025-01-26 12:03:42 +02:00

46 lines
1.4 KiB
Text

# syntax=docker/dockerfile:1
FROM gcr.io/cadvisor/cadvisor:v0.46.0 AS libpfm_donor
FROM alpine:3 AS builder
# "openssl-libs-static" fixes "Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the"
RUN apk add autoconf-archive automake bash bison boost-dev cmake coreutils net-tools \
curl ccache git gcc gdb g++ libunwind-dev libtool make ninja \
openssl-dev openssl-libs-static patch zip zstd-static
# This is required to make static linking work
RUN ls -1 /usr/lib/libboost_*.so | while read -r _file; do ln -sfv ${_file} ${_file//.so/.a}; done
# Borrow libpfm from cadvisor, so we don't have to build it ourselves
# https://github.com/google/cadvisor/blob/master/deploy/Dockerfile
COPY --from=libpfm_donor /usr/local/lib/libpfm.so* /usr/local/lib/
WORKDIR /build
COPY . ./
RUN make release
RUN build-release/dragonfly --version
FROM alpine:3
COPY tools/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY tools/docker/healthcheck.sh /usr/local/bin/healthcheck.sh
COPY --from=builder /build/build-release/dragonfly /usr/local/bin/
RUN apk --no-cache add libgcc libstdc++ \
setpriv netcat-openbsd boost-context && ldd /usr/local/bin/dragonfly
RUN addgroup -S -g 1000 dfly && adduser -S -G dfly -u 999 dfly
RUN mkdir /data && chown dfly:dfly /data
VOLUME /data
WORKDIR /data
HEALTHCHECK CMD /usr/local/bin/healthcheck.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 6379
CMD ["dragonfly", "--logtostderr"]