From a95040da28ecabfc86e35839b6f01f5464756e7e Mon Sep 17 00:00:00 2001 From: ptx96 Date: Wed, 9 Jun 2021 16:48:00 +0200 Subject: [PATCH] ver: initial commit --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3dd9ce7 --- /dev/null +++ b/Makefile @@ -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}