buildkit/hack/cross

33 lines
956 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
. $(dirname $0)/util
set -e
: ${PLATFORMS=linux/arm}
importCacheFlags=""
exportCacheFlags=""
outputFlags=""
if [ -n "$MASTERCACHE_PASSWORD" ]; then
$(dirname $0)/login_ci_cache
importCacheFlags="--cache-from=type=registry,ref=cicache.buildk.it/moby/buildkit/master:binaries-cross-helper"
exportCacheFlags="--cache-to=type=inline"
outputFlags="--output=type=image,push=true,name=cicache.buildk.it/moby/buildkit/master:binaries-cross-helper"
elif [ "$GITHUB_ACTIONS" = "true" ]; then
if [ -n "$cacheref" ]; then
importCacheFlags="--cache-from=type=local,src=$cacheref"
exportCacheFlags="--cache-to=type=local,dest=$cacheref"
fi
fi
if [ -n "$RUNC_PLATFORMS" ]; then
buildxCmd build $importCacheFlags $exportCacheFlags $outputFlags \
--target "binaries-linux-helper" \
--platform "$RUNC_PLATFORMS" \
$currentcontext
fi
buildxCmd build $importCacheFlags \
--platform "$PLATFORMS" \
$currentcontext