File tree Expand file tree Collapse file tree 3 files changed +41
-3
lines changed
Expand file tree Collapse file tree 3 files changed +41
-3
lines changed Original file line number Diff line number Diff line change 1+ FROM bash:5.2.15-alpine3.17
2+
3+ ARG TARGETARCH
4+ ARG TARGETOS
5+
6+ ENV KUBECTL_VERSION="v1.22.4"
7+
8+ RUN apk update && apk add curl
9+
10+ RUN mkdir -p /usr/bin
11+ RUN curl -LJ https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl -o /usr/bin/kubectl
12+ RUN chmod +x /usr/bin/kubectl
Original file line number Diff line number Diff line change @@ -34,12 +34,22 @@ delete-remote-tag:
3434 @echo " Deleting remote tag ${TAG} "
3535 @git push --delete origin ${TAG}
3636
37- build-image :
37+ build-image : build-image-tools build-image-kubectl
38+
39+ build-image-tools :
3840 TAG=$(BUILD_TAG ) docker buildx bake
3941
40- build-image-multiplatform :
42+ build-image-kubectl :
43+ TAG=$(BUILD_TAG ) docker buildx bake kubectl
44+
45+ build-image-multiplatform : build-image-multiplatform-tools build-image-multiplatform-kubectl
46+
47+ build-image-multiplatform-tools :
4148 TAG=$(BUILD_TAG ) docker buildx bake tools-multiplatform
4249
50+ build-image-multiplatform-kubectl :
51+ TAG=$(BUILD_TAG ) docker buildx bake kubectl-multiplatform
52+
4353tag-release-image-with-latest :
4454 make push-image BUILD_TAG=latest
4555
@@ -54,9 +64,14 @@ push-image-cache:
5464 # https://github.com/aws/containers-roadmap/issues/876
5565 docker buildx bake cache-multiplatform
5666
57- push-image :
67+ push-image : push-image-tools push-image-kubectl
68+
69+ push-image-tools :
5870 IMAGE=$(REPO_URL ) TAG=$(BUILD_TAG ) docker buildx bake tools-multiplatform --push
5971
72+ push-image-kubectl :
73+ IMAGE=$(REPO_URL ) TAG=$(BUILD_TAG ) docker buildx bake kubectl-multiplatform --push
74+
6075push-image-ecr :
6176 make push-image REPO_URL=$(ECR_REPO_URL )
6277
Original file line number Diff line number Diff line change @@ -39,10 +39,21 @@ target "default" {
3939 platforms = [" linux/amd64" ]
4040}
4141
42+ target "kubectl" {
43+ dockerfile = " Dockerfile.kubectl"
44+ tags = [" ${ IMAGE } -kubectl:${ TAG } " ]
45+ output = [" type=docker" ]
46+ platforms = [" linux/amd64" ]
47+ }
48+
4249target "tools-multiplatform" {
4350 inherits = [" default" , " multiplatform" ]
4451}
4552
53+ target "kubeclt-multiplatform" {
54+ inherits = [" kubectl" , " multiplatform" ]
55+ }
56+
4657group "cache" {
4758 targets = [" rust-cache" , " go-cache" , " tools-cache" ]
4859}
You can’t perform that action at this time.
0 commit comments