Archived
3
0

Create build system (#1)

This commit is contained in:
Matěj Žucha
2025-03-09 18:22:14 +00:00
committed by Ondřej Mekina
parent 5bb655b7de
commit 77c8deabc8
36 changed files with 1860 additions and 478 deletions

7
image/image.dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM docker.io/alpine:latest
COPY ./zmp24 /usr/bin/zmp24
COPY ./run.sh /run.sh
RUN apk update && apk add gcompat && mkdir /data
CMD [ "/run.sh" ]

17
image/image.mk Normal file
View File

@@ -0,0 +1,17 @@
.PHONY: image
image: dst/image/zmp24 dst/image/Containerfile dst/image/run.sh config.json
cd dst/image && podman build . -t \
"$$(jq -r .image.name ../../config.json):$$(jq -r .image.version ../../config.json)"
dst/image: dst
mkdir dst/image
dst/image/Containerfile: dst/image image/image.dockerfile
ln -sf $$(pwd)/image/image.dockerfile dst/image/Containerfile
dst/image/run.sh: dst/image image/run.sh
ln -f image/run.sh dst/image/run.sh
chmod +x dst/image/run.sh
dst/image/zmp24: dst/image target/$(ARCH)-unknown-linux-musl/release/zmp24
ln -f target/$(ARCH)-unknown-linux-musl/release/zmp24 dst/image/zmp24

10
image/run.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
_term() {
kill -TERM "$server_pid" 2>/dev/null
}
trap _term SIGTERM
/usr/bin/zmp24 &
server_pid=$!
wait "$server_pid"