From 5b8487501f878c8609170d569354c85e12c2ea96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Krupa?= Date: Mon, 17 Dec 2018 16:11:51 +0100 Subject: [PATCH] allow development build (#5015) * allow development build --- packaging/docker/build.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/packaging/docker/build.sh b/packaging/docker/build.sh index 949c55e650fca8..523a3719371f2b 100755 --- a/packaging/docker/build.sh +++ b/packaging/docker/build.sh @@ -20,20 +20,28 @@ if [ "${VERSION}" == "" ]; then VERSION="latest" fi -REPOSITORY="${REPOSITORY:-netdata}" - -echo "Building $VERSION of netdata container" - declare -A ARCH_MAP ARCH_MAP=( ["i386"]="386" ["amd64"]="amd64" ["armhf"]="arm" ["aarch64"]="arm64") +if [ -z ${DEVEL+x} ]; then + declare -a ARCHITECTURES=(i386 armhf aarch64 amd64) + BG="&" +else + declare -a ARCHITECTURES=(amd64) + unset DOCKER_PASSWORD + unset DOCKER_USERNAME + BG="" +fi + +REPOSITORY="${REPOSITORY:-netdata}" +echo "Building ${VERSION} of ${REPOSITORY} container" docker run --rm --privileged multiarch/qemu-user-static:register --reset # Build images using multi-arch Dockerfile. -for ARCH in i386 armhf aarch64 amd64; do - docker build --build-arg ARCH="${ARCH}-v3.8" \ +for ARCH in "${ARCHITECTURES[@]}"; do + eval docker build --build-arg ARCH="${ARCH}-v3.8" \ --tag "${REPOSITORY}:${VERSION}-${ARCH}" \ - --file packaging/docker/Dockerfile ./ & + --file packaging/docker/Dockerfile ./ ${BG} done wait