Skip to content

Commit

Permalink
Added ACR tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
Dor committed Apr 22, 2019
1 parent b7af565 commit c1a8628
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions build/build-buildpacks-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ echo

# Even though the image isn't pushed to MCR yet,
# its final name needs to be baked into the `pack` runner image ($PACK_IMAGE_DOCKERFILE)
builderFqn="mcr.microsoft.com/oryx/$DOCKER_PACK_BUILDER_IMAGE_NAME"
builderFqn="mcr.microsoft.com/oryx/$PACK_BUILDER_IMAGE_NAME"
docker tag "$DOCKER_PACK_BUILDER_IMAGE_REPO" "$builderFqn"

# Remove pack & everything that was added by it
Expand All @@ -63,8 +63,19 @@ docker build -f "$PACK_IMAGE_DOCKERFILE" $noCacheFlag \
.

if [ -n "$BUILD_NUMBER" ]; then
docker tag "$DOCKER_PACK_BUILDER_IMAGE_REPO" "$DOCKER_PACK_BUILDER_IMAGE_REPO:$BUILD_DEFINITIONNAME.$BUILD_NUMBER"
echo "$DOCKER_PACK_BUILDER_IMAGE_REPO:$BUILD_DEFINITIONNAME.$BUILD_NUMBER" >> $BUILD_IMAGES_ARTIFACTS_FILE
docker tag "$DOCKER_PACK_IMAGE_REPO:latest" "$DOCKER_PACK_IMAGE_REPO:$BUILD_DEFINITIONNAME.$BUILD_NUMBER"
echo "$DOCKER_PACK_IMAGE_REPO:$BUILD_DEFINITIONNAME.$BUILD_NUMBER" >> $BUILD_IMAGES_ARTIFACTS_FILE
BUILD_SUFFIX="$BUILD_DEFINITIONNAME.$BUILD_NUMBER"

# Tag oryxdevms
docker tag "$DOCKER_PACK_BUILDER_IMAGE_REPO" "$DOCKER_PACK_BUILDER_IMAGE_REPO:$BUILD_SUFFIX"
echo "$DOCKER_PACK_BUILDER_IMAGE_REPO:$BUILD_SUFFIX" >> $BUILD_IMAGES_ARTIFACTS_FILE

docker tag "$DOCKER_PACK_IMAGE_REPO:latest" "$DOCKER_PACK_IMAGE_REPO:$BUILD_SUFFIX"
echo "$DOCKER_PACK_IMAGE_REPO:$BUILD_SUFFIX" >> $BUILD_IMAGES_ARTIFACTS_FILE

# Tag for ACR
docker tag "$DOCKER_PACK_BUILDER_IMAGE_REPO" "$ACR_PACK_BUILDER_IMAGE_REPO:$BUILD_SUFFIX"
echo "$DOCKER_PACK_BUILDER_IMAGE_REPO:$BUILD_SUFFIX" >> $ACR_BUILD_IMAGES_ARTIFACTS_FILE

docker tag "$DOCKER_PACK_IMAGE_REPO:latest" "$ACR_PACK_IMAGE_REPO:$BUILD_SUFFIX"
echo "$DOCKER_PACK_IMAGE_REPO:$BUILD_SUFFIX" >> $ACR_BUILD_IMAGES_ARTIFACTS_FILE
fi

0 comments on commit c1a8628

Please sign in to comment.