-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmake-docker.sh
More file actions
executable file
·78 lines (70 loc) · 3.18 KB
/
Copy pathmake-docker.sh
File metadata and controls
executable file
·78 lines (70 loc) · 3.18 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
declare -a BIQT_DOCKER_BUILD_ARGS
DEFAULT_BIQT_COMMIT="master"
DEFAULT_BIQT_IRIS_COMMIT="master"
DEFAULT_BIQT_FACE_COMMIT="master"
DEFAULT_BIQT_CONTACT_DETECTOR_COMMIT="master"
if [ "${BIQT_COMMIT}" == "" ]; then
BIQT_COMMIT="${DEFAULT_BIQT_COMMIT}"
fi
BIQT_COMMIT_RESOLVED=$(git ls-remote https://github.com/mitre/biqt.git "${BIQT_COMMIT}" | awk '{print $1}')
if [ "${BIQT_COMMIT_RESOLVED}" == "" ]; then
echo "Unable to resolve BIQT ref '${BIQT_COMMIT}'." >&2
exit 1
fi
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_COMMIT="${BIQT_COMMIT_RESOLVED}")
echo "Building with BIQT ${BIQT_COMMIT} @ ${BIQT_COMMIT_RESOLVED}."
if [ "${WITH_BIQT_IRIS}" == "ON" ]; then
BIQT_DOCKER_BUILD_ARGS+=(--build-arg WITH_BIQT_IRIS=ON)
if [ "${BIQT_IRIS_COMMIT}" == "" ]; then
BIQT_IRIS_COMMIT="${DEFAULT_BIQT_IRIS_COMMIT}"
fi
BIQT_IRIS_COMMIT_RESOLVED=$(git ls-remote https://github.com/mitre/biqt-iris.git "${BIQT_IRIS_COMMIT}" | awk '{print $1}')
if [ "${BIQT_IRIS_COMMIT_RESOLVED}" == "" ]; then
echo "Unable to resolve BIQT_IRIS ref '${BIQT_IRIS_COMMIT}'." >&2
exit 1
fi
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_IRIS_COMMIT="${BIQT_IRIS_COMMIT_RESOLVED}")
echo "Building with BIQT_IRIS ${BIQT_IRIS_COMMIT} @ ${BIQT_IRIS_COMMIT_RESOLVED}"
fi
if [ "${WITH_BIQT_FACE}" == "ON" ]; then
BIQT_DOCKER_BUILD_ARGS+=(--build-arg WITH_BIQT_FACE=ON)
if [ "${BIQT_FACE_COMMIT}" == "" ]; then
BIQT_FACE_COMMIT="${DEFAULT_BIQT_FACE_COMMIT}"
fi
BIQT_FACE_COMMIT_RESOLVED=$(git ls-remote https://github.com/mitre/biqt-face.git "${BIQT_FACE_COMMIT}" | awk '{print $1}')
if [ "${BIQT_FACE_COMMIT_RESOLVED}" == "" ]; then
echo "Unable to resolve BIQT_FACE ref '${BIQT_FACE_COMMIT}'." >&2
exit 1
fi
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_FACE_COMMIT="${BIQT_FACE_COMMIT_RESOLVED}")
echo "Building with BIQT_FACE ${BIQT_FACE_COMMIT} @ ${BIQT_FACE_COMMIT_RESOLVED}."
fi
if [ "${WITH_BIQT_CONTACT_DETECTOR}" == "ON" ]; then
BIQT_DOCKER_BUILD_ARGS+=(--build-arg WITH_BIQT_CONTACT_DETECTOR=ON)
if [ "${BIQT_CONTACT_DETECTOR_COMMIT}" == "" ]; then
BIQT_CONTACT_DETECTOR_COMMIT="${DEFAULT_BIQT_CONTACT_DETECTOR_COMMIT}"
fi
BIQT_CONTACT_DETECTOR_COMMIT_RESOLVED=$(git ls-remote https://github.com/mitre/biqt-contact-detector.git "${BIQT_CONTACT_DETECTOR_COMMIT}" | awk '{print $1}')
if [ "${BIQT_CONTACT_DETECTOR_COMMIT_RESOLVED}" == "" ]; then
echo "Unable to resolve BIQT_CONTACT_DETECTOR ref '${BIQT_CONTACT_DETECTOR_COMMIT}'." >&2
exit 1
fi
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_CONTACT_DETECTOR_COMMIT="${BIQT_CONTACT_DETECTOR_COMMIT_RESOLVED}")
echo "Building with BIQT_CONTACT_DETECTOR ${BIQT_CONTACT_DETECTOR_COMMIT} @ ${BIQT_CONTACT_DETECTOR_COMMIT_RESOLVED}."
fi
BIQT_TAG="${BIQT_COMMIT}"
if [ "${BIQT_TAG}" == "master" ]; then
BIQT_TAG="latest"
fi
# Added `--pull` argument to force retrieval of the latest base image.
# Remove `--secret` argument if organization certificate does not need to be installed.
DOCKER_BUILDKIT=1 docker build \
--pull \
"${BIQT_DOCKER_BUILD_ARGS[@]}" \
--build-arg QUIRK_OPENSSL_RENEGOTIATION=ON \
--build-arg QUIRK_STRIP_QT5CORE_METADATA=ON \
--secret id=ca_file,src=ca_file.crt \
--progress=plain \
--tag "ghcr.io/mitre/biqt:${BIQT_TAG}" \
--platform=linux/amd64 \
docker/