diff --git a/.dockerignore b/.dockerignore index 0de56774c..70ccd3e4f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ _deps/* -build-* \ No newline at end of file +build-* +tools/packaging/* diff --git a/.github/workflows/reusable-container-workflow.yaml b/.github/workflows/reusable-container-workflow.yaml index 5fa932bfb..6af52d8a2 100644 --- a/.github/workflows/reusable-container-workflow.yaml +++ b/.github/workflows/reusable-container-workflow.yaml @@ -53,10 +53,10 @@ jobs: matrix: include: - flavor: alpine - dockerfile: tools/docker/Dockerfile.alpine + dockerfile: tools/packaging/Dockerfile.alpine tag_main: false - flavor: ubuntu - dockerfile: tools/docker/Dockerfile.ubuntu + dockerfile: tools/packaging/Dockerfile.ubuntu tag_main: true steps: - name: checkout diff --git a/tools/docker/Dockerfile.alpine-dev b/tools/packaging/Dockerfile.alpine-dev similarity index 86% rename from tools/docker/Dockerfile.alpine-dev rename to tools/packaging/Dockerfile.alpine-dev index 16fe95440..1e71d6fea 100644 --- a/tools/docker/Dockerfile.alpine-dev +++ b/tools/packaging/Dockerfile.alpine-dev @@ -6,7 +6,7 @@ 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 \ curl ccache git gcc gdb g++ libunwind-dev libtool libxml2-dev make ninja \ - openssl-dev openssl-libs-static patch zip zstd-dev icu-dev + openssl-dev openssl-libs-static patch zip zstd-static icu-dev # 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 @@ -25,17 +25,18 @@ RUN build-opt/dragonfly --version FROM alpine:3 -RUN apk --no-cache add libgcc libstdc++ libunwind boost-context \ - zstd-dev su-exec netcat-openbsd openssl libxml2 +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-opt/dragonfly /usr/local/bin/ + +RUN apk --no-cache add libgcc libstdc++ \ + su-exec netcat-openbsd libxml2 icu 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 -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-opt/dragonfly /usr/local/bin/ HEALTHCHECK CMD /usr/local/bin/healthcheck.sh ENTRYPOINT ["entrypoint.sh"] diff --git a/tools/docker/Dockerfile.alpine-prod.wip b/tools/packaging/Dockerfile.alpine-prod.wip similarity index 100% rename from tools/docker/Dockerfile.alpine-prod.wip rename to tools/packaging/Dockerfile.alpine-prod.wip diff --git a/tools/docker/Dockerfile.ubuntu-dev b/tools/packaging/Dockerfile.ubuntu-dev similarity index 100% rename from tools/docker/Dockerfile.ubuntu-dev rename to tools/packaging/Dockerfile.ubuntu-dev diff --git a/tools/docker/Dockerfile.ubuntu-prod b/tools/packaging/Dockerfile.ubuntu-prod similarity index 100% rename from tools/docker/Dockerfile.ubuntu-prod rename to tools/packaging/Dockerfile.ubuntu-prod