-
Notifications
You must be signed in to change notification settings - Fork 4
/
make-docker.sh
executable file
·62 lines (54 loc) · 2.59 KB
/
make-docker.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
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
declare -a 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}')
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_COMMIT="${BIQT_COMMIT}")
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}')
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_IRIS_COMMIT="${BIQT_IRIS_COMMIT}")
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}')
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_FACE_COMMIT="${BIQT_FACE_COMMIT}")
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}')
BIQT_DOCKER_BUILD_ARGS+=(--build-arg BIQT_CONTACT_DETECTOR_COMMIT="${BIQT_CONTACT_DETECTOR_COMMIT}")
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.
DOCKER_BUILDKIT=1 docker build \
--pull \
${BIQT_DOCKER_BUILD_ARGS[@]} \
--build-arg INSTALL_MITRE_CERTIFICATES=ON \
--build-arg QUIRK_OPENSSL_RENEGOTIATION=ON \
--build-arg QUIRK_STRIP_QT5CORE_METADATA=ON \
--secret id=SSH_PRIVATE_KEY,src=$HOME/.ssh/id_rsa \
--secret id=ALT_OPENSSL_CONF,src=docker/openssl.cnf \
--progress=plain \
--tag ghcr.io/mitre/biqt:${BIQT_TAG} \
docker/