forked from id-Software/Quake
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-docker.sh
More file actions
executable file
·35 lines (24 loc) · 984 Bytes
/
build-docker.sh
File metadata and controls
executable file
·35 lines (24 loc) · 984 Bytes
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
35
#!/bin/bash
set -e
if ! command -v docker >/dev/null 2>&1; then
echo "error: docker not found; have you installed it?"
exit 1
fi
function cleanup() {
docker stop -t0 quake >/dev/null 2>&1 || true
docker rm -f quake >/dev/null 2>&1 || true
}
trap cleanup EXIT
detected_arch="amd64"
if [[ "$(uname -p)" == "arm" ]]; then
detected_arch="arm64"
fi
desired_arch="${ARCH:-${detected_arch}}"
if [[ "${desired_arch}" != "amd64" ]]; then
echo "error: only ARCH=amd64 is supported for now (detected_arch=${detected_arch}, desired_arch=${desired_arch})"
exit 1
fi
docker build --platform="linux/${desired_arch}" --progress=plain --build-arg "DEBUG=${DEBUG:-0}" -t "initialed85/quake-build:latest" -f ./Dockerfile .
docker run --platform="linux/${desired_arch}" -d --rm --entrypoint bash --name quake "initialed85/quake-build:latest" -c 'tail -F /dev/null'
rm -fr ./WinQuake/build-docker >/dev/null 2>&1 || true
docker cp quake:/srv/WinQuake/build-linux ./WinQuake/build-docker