فهرست منبع

Static build with alpine container

Kajetan Johannes Hammerle 6 روز پیش
والد
کامیت
850aca36e9
3فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
  1. 1 0
      .gitignore
  2. 3 0
      Dockerfile
  3. 12 0
      build_container.sh

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 build_debug
 build_profile
 build_release
+build_docker
 install
 profile
 tasks_settings

+ 3 - 0
Dockerfile

@@ -0,0 +1,3 @@
+FROM alpine:latest
+
+RUN apk add gcc musl-dev cmake samurai

+ 12 - 0
build_container.sh

@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cd "$(dirname "$0")"
+
+podman build . -t builder:latest
+
+podman run -v $PWD:$PWD builder:latest sh -c " \
+    cd $PWD
+    cmake -S . -B build_docker -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=\"-static\"
+    ninja -C build_docker
+    strip build_docker/basic
+    "