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 ARG DI_VER=1.2.5
RUN apk add --update --no-cache \ RUN apk add --update --no-cache \
build-base \ build-base \
make \ make \
cmake \
boost-dev \
curl curl
WORKDIR /app WORKDIR /app
@ -20,17 +18,17 @@ RUN curl -Lo - "https://github.com/Yelp/dumb-init/archive/refs/tags/v${DI_VER}.t
COPY . ./ COPY . ./
RUN make prod && \ RUN make CFLAGS='-O3 -static' LDFLAGS='-flto' && \
strip build/Release/lander 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 && \ RUN mkdir /data && \
mkdir /data && \
chown -R 1000:1000 /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 WORKDIR /data