#!/usr/bin/env bash # Usage: ./extract.sh <arch> [<binary_save_location>] BORG_ARCH=${1:-aarch64} BORG_BINARY=${2:-borg-${BORG_ARCH}} #if [[ "$(docker images -q "borg:${BORG_ARCH}" 2> /dev/null)" == "" ]]; then if ! docker inspect "borg:${BORG_ARCH}" >/dev/null 2>&1; then echo "Couldn't find the 'borg:${BORG_ARCH}' image!" echo "Create the image first, using './build.sh ${BORG_ARCH}'" exit 1 fi #docker run -v "${PWD}":"/opt/mount" --rm --entrypoint \ # cp "borg:${BORG_ARCH}" "/usr/bin/borg" "/opt/mount/${BORG_BINARY}" docker run --rm --entrypoint cat "borg:${BORG_ARCH}" /usr/bin/borg > "${BORG_BINARY}" chmod +x "${BORG_BINARY}"