-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Choose kubectl version from tagged commit; | ||
# if no tag comes out, it will use "stable" binary | ||
KUBECTL_VERSION ?= $$(git describe --abbrev=0 --tags || curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) | ||
|
||
# Image URL to use while building/pushing image targets | ||
IMG ?= quay.io/clastix/kubectl:$(KUBECTL_VERSION) | ||
|
||
# Supported platforms for multiarch docker image | ||
PLATFORMS ?= linux/amd64,linux/arm64,linux/arm | ||
|
||
# Build the docker image | ||
docker-build: | ||
docker build . -t ${IMG} --build-arg KUBECTL_VERSION=$(KUBECTL_VERSION) | ||
|
||
# Push the docker image | ||
docker-push: | ||
docker push ${IMG} | ||
|
||
# Build multiarch docker image with "docker buildx" and push it | ||
docker-buildx-push: | ||
docker buildx build . -t ${IMG} --build-arg KUBECTL_VERSION=${KUBECTL_VERSION} \ | ||
--platform ${PLATFORMS} \ | ||
--push | ||
|
||
# Check docker image manifest | ||
docker-check-manifest: | ||
docker manifest inspect ${IMG} |