Skip to content

Commit 3e9f852

Browse files
authored
chore: add target to tag and push image with "latest" tag (#227)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 3bebf06 commit 3e9f852

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ build-image:
7878
docker tag $(IMAGE_REPO_NAME):latest-$(ARCH_SUFFIX) $(IMAGE_REPO_NAME):$(TAG)-$(ARCH_SUFFIX)
7979
docker tag $(IMAGE_REPO_NAME):latest-$(ARCH_SUFFIX) $(IMAGE_REPO_NAME):$(VERSION)-$(ARCH_SUFFIX)
8080

81+
.PHONY: tag-latest
82+
tag-latest:
83+
docker tag $(IMAGE_REPO_NAME):latest-amd64 $(IMAGE_REPO_NAME):latest
84+
85+
.PHONY: publish-dockerhub-latest
86+
publish-dockerhub-latest:
87+
docker push $(IMAGE_REPO_NAME):latest
88+
8189
.PHONY: publish-dockerhub
8290
publish-dockerhub:
8391
docker push $(IMAGE_REPO_NAME):latest-$(ARCH_SUFFIX)

buildspec.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ phases:
2121
- echo Building Docker image...
2222
- make build-image
2323
- make publish-dockerhub
24+
- |
25+
if [ ARCH_SUFFIX = "amd64" ]; then
26+
make tag-latest
27+
make publish-dockerhub-latest
28+
fi
2429
post_build:
2530
commands:
2631
- ok && echo Build completed on `date`

0 commit comments

Comments
 (0)