docker-icingaweb2/build.bash
Alexander A. Klimov 101a4db635 Merge Dockerfiles
Rationale: for security reasons include the latest deps, at least in release images.
Therefore include them everywhere, so the CI warns early enough.
2021-06-24 16:53:39 +02:00

39 lines
847 B
Bash
Executable File

#!/bin/bash
# Icinga Web 2 Docker image | (c) 2020 Icinga GmbH | GPLv2+
set -exo pipefail
IW2SRC="$1"
export MODS_BRANCH="$2"
if [ -z "$IW2SRC" ]; then
cat <<EOF >&2
Usage: ${0} /icingaweb2/source/dir
EOF
false
fi
IW2SRC="$(realpath "$IW2SRC")"
BLDCTX="$(realpath "$(dirname "$0")")"
docker build -f "${BLDCTX}/action.Dockerfile" -t icinga/icingaweb2-builder "$BLDCTX"
docker run --rm -i \
-v "${IW2SRC}:/iw2src:ro" \
-v "${BLDCTX}:/bldctx:ro" \
-v /var/run/docker.sock:/var/run/docker.sock \
-e MODS_BRANCH \
icinga/icingaweb2-builder bash <<EOF
set -exo pipefail
git -C /iw2src archive --prefix=iw2cp/icingaweb2/ HEAD |tar -xC /
cd /iw2cp
/bldctx/get-mods.sh "$MODS_BRANCH"
/bldctx/composer.bash
patch -d icingaweb2 -p0 < /bldctx/icingaweb2.patch
cp -r /entrypoint .
docker build -f /bldctx/Dockerfile -t icinga/icingaweb2 .
EOF