diff --git a/Dockerfile b/Dockerfile index b430e4a..7fc77f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -FROM alpine:3.16.3 AS builder +FROM alpine:3.18.0 AS builder ARG DI_VER=1.2.5 RUN apk add --update --no-cache \ build-base \ make \ - cmake \ - boost-dev \ curl WORKDIR /app @@ -20,17 +18,17 @@ RUN curl -Lo - "https://github.com/Yelp/dumb-init/archive/refs/tags/v${DI_VER}.t COPY . ./ -RUN make prod && \ - strip build/Release/lander +RUN make CFLAGS='-O3 -static' LDFLAGS='-flto' && \ + strip build/lander && \ + [ "$(readelf -d build/lander | grep NEEDED | wc -l)" = 0 ] -FROM alpine:3.16.3 +FROM busybox:1.36.1 -RUN apk add --update --no-cache boost && \ - mkdir /data && \ +RUN mkdir /data && \ chown -R 1000:1000 /data -COPY --from=builder /app/build/Release/lander /app/dumb-init /bin/ +COPY --from=builder /app/build/lander /app/dumb-init /bin/ WORKDIR /data