Skip to content

Commit

Permalink
allow development build (netdata#5015)
Browse files Browse the repository at this point in the history
* allow development build
  • Loading branch information
paulfantom authored Dec 17, 2018
1 parent 989604b commit 5b84875
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions packaging/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5b84875

Please sign in to comment.