#!/usr/bin/env sh # Usage: ./build.sh [] # For available architectures see: # https://docs.resin.io/reference/base-images/base-images/ BORG_ARCH=${1} BORG_VERSION=${2:-1.1.7} DOCKER_IMAGE=borg:${BORG_VERSION}-${BORG_ARCH} if [ -z "${BORG_ARCH}" ]; then echo "Usage: ./build.sh []"; echo "No arch provided"; exit 1; fi echo "Building BorgBackup ${BORG_VERSION} for ${BORG_ARCH}" # https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/ docker run --rm --privileged multiarch/qemu-user-static:register --reset docker build \ --build-arg "BORG_ARCH=${BORG_ARCH}" \ --build-arg "BORG_VERSION=${BORG_VERSION}" \ -t "${DOCKER_IMAGE}" .