dropshell/source/Dockerfile
Your Name 8ec4976cc0
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 1m30s
Playing with static still
2025-05-25 23:59:50 +12:00

36 lines
756 B
Docker

FROM --platform=$BUILDPLATFORM alpine:latest AS builder
# Install build dependencies
RUN apk add --no-cache \
build-base \
cmake \
git \
musl-dev \
curl \
bash \
musl \
g++ \
ninja \
linux-headers
# Set working directory
WORKDIR /build
# Copy source files
COPY . .
# Configure and build
RUN mkdir -p build_static
RUN cmake -G Ninja -B build_static -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
-DBUILD_SHARED_LIBS=OFF
RUN cmake --build build_static
# Final stage that only contains the binary
FROM scratch AS dropshell
COPY --from=builder /build/build_static/dropshell /dropshell