about summary refs log tree commit diff
path: root/Dockerfile.alpine
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2024-01-01 18:59:49 +0100
committerLeah Neukirchen <leah@vuxu.org>2024-01-01 18:59:49 +0100
commitce8c010d2f87e7b74065619ce698058b37d24106 (patch)
treed78b0597d6882b1dc4a3e46e5c6a0b58a821a10e /Dockerfile.alpine
parenta9f32c27413b397b136d9630503ac42ac4dae6d3 (diff)
downloadnitro-ce8c010d2f87e7b74065619ce698058b37d24106.tar.gz
nitro-ce8c010d2f87e7b74065619ce698058b37d24106.tar.xz
nitro-ce8c010d2f87e7b74065619ce698058b37d24106.zip
add docker setup for static builds using alpine
Diffstat (limited to 'Dockerfile.alpine')
-rw-r--r--Dockerfile.alpine16
1 files changed, 16 insertions, 0 deletions
diff --git a/Dockerfile.alpine b/Dockerfile.alpine
new file mode 100644
index 0000000..a16b827
--- /dev/null
+++ b/Dockerfile.alpine
@@ -0,0 +1,16 @@
+FROM alpine:latest
+
+RUN apk update \
+    && apk --no-cache --update add build-base
+
+WORKDIR /bin.alpine
+
+COPY nitro.c .
+COPY nitroctl.c .
+COPY Makefile .
+
+RUN make CFLAGS="-Os -Wl,--gc-sections -fno-asynchronous-unwind-tables -fno-stack-protector -fno-stack-clash-protection" LDFLAGS="-static"
+
+RUN nm --size-sort nitro
+RUN ls -l nitro nitroctl
+RUN size nitro nitroctl