'Generic Commit'
All checks were successful
dropshell-build / build (push) Successful in 1m3s

This commit is contained in:
Your Name
2025-06-03 00:38:14 +12:00
parent 3fea581249
commit 1da19b9191
12 changed files with 62 additions and 59 deletions

View File

@ -0,0 +1,44 @@
FROM --platform=$BUILDPLATFORM alpine:latest AS builder
ARG PROJECT
# Install build dependencies
RUN apk add --no-cache \
build-base \
cmake \
git \
musl-dev \
curl \
bash \
musl \
g++ \
ninja \
linux-headers \
mold \
zlib-static
# Set working directory
WORKDIR /build
# Copy source files
COPY . .
# Configure and build
RUN mkdir -p build_static && \
cmake -G Ninja -B build_static -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
-DZLIB_BUILD_SHARED=OFF \
-DZLIB_BUILD_STATIC=ON \
-DBUILD_SHARED_LIBS=OFF \
-DPROJECT_NAME="${PROJECT}" \
${CMAKE_TOOLCHAIN_FILE:+-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE}
RUN cmake --build build_static
# Final stage that only contains the binary
FROM scratch AS project
ARG PROJECT
COPY --from=builder /build/build_static/${PROJECT} /${PROJECT}