Skip to content

Commit

Permalink
Fix rootless tag
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 26, 2020
1 parent 7437b47 commit 4140a8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions hack/images
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 "
Expand All @@ -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

0 comments on commit 4140a8e

Please sign in to comment.