Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Dockerfile.kubectl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM bash:5.2.15-alpine3.17

ARG TARGETARCH
ARG TARGETOS

ENV KUBECTL_VERSION="v1.26.4"
ADD https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl /usr/bin/kubectl
RUN chmod +x /usr/bin/kubectl
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@ delete-remote-tag:
@echo "Deleting remote tag ${TAG}"
@git push --delete origin ${TAG}

build-image:
build-image: build-image-tools build-image-kubectl

build-image-tools:
TAG=$(BUILD_TAG) docker buildx bake

build-image-multiplatform:
build-image-kubectl:
TAG=$(BUILD_TAG) docker buildx bake kubectl

build-image-multiplatform: build-image-multiplatform-tools build-image-multiplatform-kubectl

build-image-multiplatform-tools:
TAG=$(BUILD_TAG) docker buildx bake tools-multiplatform

build-image-multiplatform-kubectl:
TAG=$(BUILD_TAG) docker buildx bake kubectl-multiplatform

tag-release-image-with-latest:
make push-image BUILD_TAG=latest

Expand All @@ -54,9 +64,14 @@ push-image-cache:
# https://github.com/aws/containers-roadmap/issues/876
docker buildx bake cache-multiplatform

push-image:
push-image: push-image-tools push-image-kubectl

push-image-tools:
IMAGE=$(REPO_URL) TAG=$(BUILD_TAG) docker buildx bake tools-multiplatform --push

push-image-kubectl:
IMAGE=$(REPO_URL) TAG=$(BUILD_TAG) docker buildx bake kubectl-multiplatform --push

push-image-ecr:
make push-image REPO_URL=$(ECR_REPO_URL)

Expand Down
11 changes: 11 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,21 @@ target "default" {
platforms = ["linux/amd64"]
}

target "kubectl" {
dockerfile = "Dockerfile.kubectl"
tags = ["${IMAGE}-kubectl:${TAG}"]
output = ["type=docker"]
platforms = ["linux/amd64"]
}

target "tools-multiplatform" {
inherits = ["default", "multiplatform"]
}

target "kubeclt-multiplatform" {
inherits = ["kubectl", "multiplatform"]
}

group "cache" {
targets = ["rust-cache", "go-cache", "tools-cache"]
}
Expand Down