2018-10-02 17:03:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
. $(dirname $0)/util
|
|
|
|
|
|
|
|
: ${PLATFORMS=linux/arm}
|
|
|
|
|
2019-08-08 00:50:00 +00:00
|
|
|
importCacheFlags=""
|
|
|
|
if [ -n "$cacheref" ]; then
|
|
|
|
importCacheFlags="--import-cache=type=registry,ref=$cacheref:binaries"
|
|
|
|
fi
|
|
|
|
|
2018-10-02 17:03:32 +00:00
|
|
|
set -ex
|
|
|
|
|
2019-08-08 00:50:00 +00:00
|
|
|
if [ -n "$MASTERCACHE_PASSWORD" ] && [ -n "$RUNC_PLATFORMS" ]; then
|
|
|
|
repo="cicache.buildk.it/moby/buildkit/master"
|
|
|
|
$(dirname $0)/login_ci_cache
|
|
|
|
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
|
|
|
$currentcontextBuildctl \
|
|
|
|
--opt target=binaries-linux-helper \
|
|
|
|
--opt platform=$RUNC_PLATFORMS \
|
|
|
|
--import-cache cicache.buildk.it/moby/buildkit/master:binaries-cross-helper \
|
|
|
|
--export-cache type=inline --output type=image,push=true,name=$repo:binaries-cross-helper
|
|
|
|
fi
|
|
|
|
|
|
|
|
buildctl build --progress=plain --frontend=dockerfile.v0 \
|
2019-10-18 07:36:14 +00:00
|
|
|
$currentcontextBuildctl \
|
2019-08-08 00:50:00 +00:00
|
|
|
--opt platform=$PLATFORMS \
|
|
|
|
--import-cache cicache.buildk.it/moby/buildkit/master:binaries-cross-helper
|