lander/Dockerfile

43 lines
743 B
Docker
Raw Normal View History

FROM alpine:3.16.3 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 \
cmake \
2022-11-15 21:24:00 +01:00
boost-dev \
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 . ./
RUN make prod && \
2022-11-15 21:24:00 +01:00
strip build/Release/lander
FROM alpine:3.16.3
2022-11-21 16:28:27 +01:00
ENV LANDER_DATA_DIR=/data
2022-11-15 21:24:00 +01:00
RUN apk add --update --no-cache boost && \
mkdir /data && \
chown -R 1000:1000 /data
COPY --from=builder /app/build/Release/lander /app/dumb-init /bin/
WORKDIR /data
USER 1000:1000
ENTRYPOINT ["/bin/dumb-init", "--"]
CMD ["/bin/lander"]