chore: updated dockerfile

c-web-server
Jef Roosens 2023-05-29 17:16:17 +02:00
parent 464753d627
commit 34ecb7eb40
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 7 additions and 9 deletions

View File

@ -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