2018-10-02 17:03:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
. $(dirname $0)/util
|
2020-11-24 21:51:52 +00:00
|
|
|
set -eu
|
2018-10-02 17:03:32 +00:00
|
|
|
|
|
|
|
: ${TARGETPLATFORM=}
|
2020-11-24 21:51:52 +00:00
|
|
|
: ${BUILDKITD_TAGS=}
|
2018-10-02 17:03:32 +00:00
|
|
|
|
2020-11-24 21:51:52 +00:00
|
|
|
platformFlag="--platform local"
|
|
|
|
if [ -n "$TARGETPLATFORM" ]; then
|
|
|
|
platformFlag="--platform $TARGETPLATFORM"
|
|
|
|
fi
|
2018-10-02 17:03:32 +00:00
|
|
|
|
2019-08-08 00:50:00 +00:00
|
|
|
buildkitdTagsFlags=""
|
|
|
|
if [ -n "$BUILDKITD_TAGS" ]; then
|
2020-11-24 21:51:52 +00:00
|
|
|
buildkitdTagsFlags="--build-arg=BUILDKITD_TAGS=\"$BUILDKITD_TAGS\""
|
2019-08-08 00:50:00 +00:00
|
|
|
fi
|
|
|
|
|
2020-11-24 21:51:52 +00:00
|
|
|
buildxCmd build $platformFlag $buildkitdTagsFlags \
|
|
|
|
--target "binaries" \
|
|
|
|
--output "type=local,dest=./bin/" \
|
|
|
|
.
|