From ec788fec85a00b9c90214cc81148a87201fa31fd Mon Sep 17 00:00:00 2001 From: cathugger Date: Sun, 6 Aug 2023 19:07:51 +0300 Subject: [PATCH] revamp docker support don't use volume, use latest alpine so i won't need to bump it use multistage static build for minimal size with stripping correctly save git version details --- contrib/docker/.dockerignore | 1 - contrib/docker/Dockerfile | 31 ++++++++++++------------------- 2 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 contrib/docker/.dockerignore diff --git a/contrib/docker/.dockerignore b/contrib/docker/.dockerignore deleted file mode 100644 index 6b8710a..0000000 --- a/contrib/docker/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index 97aaac3..afbcc41 100644 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -1,21 +1,14 @@ -FROM alpine:3.12.0 +FROM alpine:latest AS builder +RUN apk add --no-cache gcc libc-dev libsodium-dev libsodium-static make autoconf git +WORKDIR /app +COPY . . +RUN ./autogen.sh +RUN ./configure --enable-amd64-51-30k CFLAGS="-O3 -march=x86-64 -mtune=generic -fomit-frame-pointer" LDFLAGS="-static" +RUN make +RUN strip mkp224o -LABEL maintainer="sstefin@bk.ru" +FROM scratch +WORKDIR /app +COPY --from=builder /app/mkp224o . -#Installing all the dependencies -RUN apk add --no-cache gcc libsodium-dev make autoconf build-base - -WORKDIR /mkp224o - -COPY . /mkp224o/ - -RUN ./autogen.sh \ - && ./configure \ - && make \ - && cp /mkp224o/mkp224o /usr/local/bin/ - -VOLUME /root/data - -WORKDIR /root/data - -ENTRYPOINT ["mkp224o"] +ENTRYPOINT ["./mkp224o"]