Fix rootless tag

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
v0.8
CrazyMax 2020-11-26 05:51:51 +01:00
parent 7437b4777c
commit 4140a8e176
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
2 changed files with 8 additions and 3 deletions

View File

@ -7,6 +7,7 @@ binaries: FORCE
images: FORCE
# moby/buildkit:local and moby/buildkit:local-rootless are created on Docker
hack/images local moby/buildkit
TARGET=rootless hack/images local moby/buildkit
install: FORCE
mkdir -p $(DESTDIR)$(bindir)

View File

@ -35,6 +35,11 @@ if [ -n "$TARGET" ]; then
targetFlag="--target=$TARGET"
fi
tagMain="$REPO:$TAG"
if [ -n "$TARGET" ]; then
tagMain="$tagMain-$TARGET"
fi
tagLatest=""
if [[ "$versionTag" == "$TAG" ]]; then
if [ -n "$TARGET" ]; then
@ -44,7 +49,7 @@ if [[ "$versionTag" == "$TAG" ]]; then
fi
fi
importCacheFlags="--cache-from=type=registry,ref=$REPO:$TAG$tagLatest "
importCacheFlags="--cache-from=type=registry,ref=$tagMain$tagLatest "
if [[ -n "$cacheref" ]] && [[ "$cachetype" = "local" ]]; then
for ref in $cacheref; do
importCacheFlags="$importCacheFlags--cache-from=type=local,src=$ref "
@ -58,6 +63,5 @@ fi
buildxCmd build $targetFlag $importCacheFlags $exportCacheFlags \
--platform "$PLATFORMS" \
--tag "$REPO:$TAG$tagLatest" \
--output "type=image,$pushFlag" \
--output "type=image,name=$tagMain$tagLatest,$pushFlag" \
$currentref