-
Notifications
You must be signed in to change notification settings - Fork 1
/
Build.sh
executable file
·34 lines (32 loc) · 952 Bytes
/
Build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/mksh
# -*- mode: sh -*-
# © Thorsten Glaser, DTAG LLCTO, Qvest Digital Ⓕ MirBSD
export LC_ALL=C TZ=UTC
unset LANGUAGE
set -exo pipefail
docker pull alpine:latest
sleep 1
docker pull alpine:latest
cd "$(dirname "$0")"
rm -rf obj image/saachenzip
[[ ! -h image/saachenzip && ! -e image/saachenzip ]]
git=$(git describe --always --dirty)
mkdir obj
cp src/* obj/
# for apparmour, see https://stackoverflow.com/a/78624998/2171120
docker run --security-opt apparmor=unconfined \
--rm -v "$PWD/obj:/mnt" \
alpine:latest sh /mnt/bld.sh
install -c -o "$KSHUID" -g "$KSHGID" -m 0555 \
obj/saachenzip image/
rm -rf obj
cd image
parent=$(docker import "$PWD/base.tgz")
tag=saachenzip:git-$git
docker build --no-cache \
--build-arg parentimage="$parent" \
--build-arg gitdescribe="$git" \
-t "$tag" .
rm -f saachenzip
docker tag "$tag" saachenzip:latest
: "success; run \"docker system prune -f --volumes\" occasionally (RTFM!)"