lander/Dockerfile

39 lines
730 B
Docker
Raw Normal View History

2023-05-29 17:16:17 +02:00
FROM alpine:3.18.0 AS builder
2022-11-15 21:24:00 +01:00
ARG DI_VER=1.2.5
RUN apk add --update --no-cache \
build-base \
make \
2022-11-15 21:24:00 +01:00
curl
WORKDIR /app
2022-11-15 21:24:00 +01:00
# Build dumb-init
RUN curl -Lo - "https://github.com/Yelp/dumb-init/archive/refs/tags/v${DI_VER}.tar.gz" | tar -xzf - && \
cd "dumb-init-${DI_VER}" && \
make SHELL=/bin/sh && \
mv dumb-init .. && \
cd ..
COPY . ./
2023-05-29 17:16:17 +02:00
RUN make CFLAGS='-O3 -static' LDFLAGS='-flto' && \
strip build/lander && \
[ "$(readelf -d build/lander | grep NEEDED | wc -l)" = 0 ]
2022-11-15 21:24:00 +01:00
2023-05-29 17:16:17 +02:00
FROM busybox:1.36.1
2022-11-15 21:24:00 +01:00
2023-05-29 17:16:17 +02:00
RUN mkdir /data && \
2022-11-15 21:24:00 +01:00
chown -R 1000:1000 /data
2023-05-29 17:16:17 +02:00
COPY --from=builder /app/build/lander /app/dumb-init /bin/
2022-11-15 21:24:00 +01:00
WORKDIR /data
USER 1000:1000
ENTRYPOINT ["/bin/dumb-init", "--"]
CMD ["/bin/lander"]