34 lines
645 B
Docker
34 lines
645 B
Docker
FROM alpine:latest
|
|
|
|
# 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
|
|
|
|
# The resulting binary will be in build_static/dropshell |