Skip to content

Commit

Permalink
revamp docker support
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cathugger committed Aug 6, 2023
1 parent 951437b commit ec788fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
1 change: 0 additions & 1 deletion contrib/docker/.dockerignore

This file was deleted.

35 changes: 14 additions & 21 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
FROM alpine:3.12.0

LABEL maintainer="[email protected]"

#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"]
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

FROM scratch
WORKDIR /app
COPY --from=builder /app/mkp224o .

ENTRYPOINT ["./mkp224o"]

0 comments on commit ec788fe

Please sign in to comment.