diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 591a39535..28a9af8bf 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -21,130 +21,28 @@ builds: - "-s -w -X pkg.Version={{.Version}} -X pkg.CommitID={{.Commit}} -buildid=''" dockers: - - ids: - - aws-iam-authenticator - use: buildx + - use: buildx goarch: amd64 - dockerfile: Dockerfile.scratch + goos: linux build_flag_templates: - - "--platform=linux/amd64" + - "--platform=linux/amd64" + dockerfile: Dockerfile.goreleaser image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-scratch-amd64" - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amd64" - - ids: - - aws-iam-authenticator - use: buildx + - use: buildx goarch: arm64 - dockerfile: Dockerfile.scratch + goos: linux build_flag_templates: - - "--platform=linux/arm64" + - "--platform=linux/arm64" + dockerfile: Dockerfile.goreleaser image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-scratch-arm64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-arm64" - - ids: - - aws-iam-authenticator - dockerfile: Dockerfile.alpine-3.6 - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-3.6" - - ids: - - aws-iam-authenticator - use: buildx - goarch: amd64 - dockerfile: Dockerfile.alpine-3.7 - build_flag_templates: - - "--platform=linux/amd64" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-3.7-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-amd64" - - ids: - - aws-iam-authenticator - use: buildx - goarch: arm64 - dockerfile: Dockerfile.alpine-3.7 - build_flag_templates: - - "--platform=linux/arm64" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-3.7-arm64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-arm64" - - ids: - - aws-iam-authenticator - dockerfile: Dockerfile.debian-jessie - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-jessie" - - ids: - - aws-iam-authenticator - use: buildx - goarch: amd64 - dockerfile: Dockerfile.debian-stretch - build_flag_templates: - - "--platform=linux/amd64" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-stretch-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-amd64" - - ids: - - aws-iam-authenticator - use: buildx - goarch: arm64 - dockerfile: Dockerfile.debian-stretch - build_flag_templates: - - "--platform=linux/arm64" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-stretch-3.7-arm64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-arm64" - - ids: - - aws-iam-authenticator - use: buildx - goarch: amd64 - dockerfile: Dockerfile.amazonlinux-2 - build_flag_templates: - - "--platform=linux/amd64" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-2-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-amd64" - - ids: - - aws-iam-authenticator - use: buildx - goarch: arm64 - dockerfile: Dockerfile.amazonlinux-2 - build_flag_templates: - - "--platform=linux/arm64" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-2-arm64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-arm64" + - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-arm64" docker_manifests: - - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-scratch" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-scratch-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-scratch-arm64" - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}" image_templates: - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amd64" - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-arm64" - - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-3.7" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-3.7-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-3.7-arm64" - - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-alpine-arm64" - - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-stretch" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-stretch-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-stretch-arm64" - - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-debian-arm64" - - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-2" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-2-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-2-arm64" - - name_template: "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux" - image_templates: - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-amd64" - - "602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-iam-authenticator:{{ .Tag }}-amazonlinux-arm64" snapshot: name_template: "git-{{.ShortCommit}}" diff --git a/Dockerfile.alpine-3.7 b/Dockerfile.alpine-3.7 deleted file mode 100644 index cc79bc73f..000000000 --- a/Dockerfile.alpine-3.7 +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2017 by the contributors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM alpine:3.7 -RUN adduser -D -u 10000 aws-iam-authenticator -RUN apk add --update ca-certificates -COPY aws-iam-authenticator / -RUN chown aws-iam-authenticator /aws-iam-authenticator -USER aws-iam-authenticator -ENTRYPOINT ["/aws-iam-authenticator"] diff --git a/Dockerfile.amazonlinux-2 b/Dockerfile.amazonlinux-2 deleted file mode 100644 index 5e77e6020..000000000 --- a/Dockerfile.amazonlinux-2 +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2019 by the contributors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM amazonlinux:2 -RUN yum install -y shadow-utils && \ - adduser \ - --system \ - --no-create-home \ - --uid 10000 \ - aws-iam-authenticator && \ - yum update -y -COPY aws-iam-authenticator / -RUN chown aws-iam-authenticator /aws-iam-authenticator -USER aws-iam-authenticator -ENTRYPOINT ["/aws-iam-authenticator"] diff --git a/Dockerfile.debian-jessie b/Dockerfile.debian-jessie deleted file mode 100644 index 368ee2069..000000000 --- a/Dockerfile.debian-jessie +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2017 by the contributors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM debian:jessie -RUN adduser \ - --system \ - --no-create-home \ - --uid 10000 \ - --disabled-password \ - --disabled-login \ - aws-iam-authenticator && \ - apt-get update && \ - apt-get install -y ca-certificates && \ - rm -rf /var/lib/apt/lists/* -COPY aws-iam-authenticator / -RUN chown aws-iam-authenticator /aws-iam-authenticator -USER aws-iam-authenticator -ENTRYPOINT ["/aws-iam-authenticator"] diff --git a/Dockerfile.debian-stretch b/Dockerfile.debian-stretch deleted file mode 100644 index 8d6e24b6b..000000000 --- a/Dockerfile.debian-stretch +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2017 by the contributors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM debian:stretch -RUN adduser \ - --system \ - --no-create-home \ - --uid 10000 \ - --disabled-password \ - --disabled-login \ - aws-iam-authenticator && \ - apt-get update && \ - apt-get install -y ca-certificates && \ - rm -rf /var/lib/apt/lists/* -COPY aws-iam-authenticator / -RUN chown aws-iam-authenticator /aws-iam-authenticator -USER aws-iam-authenticator -ENTRYPOINT ["/aws-iam-authenticator"] diff --git a/Dockerfile.alpine-3.6 b/Dockerfile.goreleaser similarity index 61% rename from Dockerfile.alpine-3.6 rename to Dockerfile.goreleaser index 583a99249..675f18bc5 100644 --- a/Dockerfile.alpine-3.6 +++ b/Dockerfile.goreleaser @@ -1,4 +1,4 @@ -# Copyright 2017 by the contributors. +# Copyright 2022 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,11 +11,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +ARG image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2021-12-01-1638322424 -FROM alpine:3.6 -RUN adduser -D -u 10000 aws-iam-authenticator -RUN apk add --update ca-certificates -COPY aws-iam-authenticator / -RUN chown aws-iam-authenticator /aws-iam-authenticator -USER aws-iam-authenticator +FROM public.ecr.aws/eks-distro/kubernetes/go-runner:v0.9.0-eks-1-21-4 as go-runner + +FROM $image +COPY --from=go-runner /usr/local/bin/go-runner /usr/local/bin/go-runner +COPY aws-iam-authenticator /aws-iam-authenticator ENTRYPOINT ["/aws-iam-authenticator"] diff --git a/Dockerfile.scratch b/Dockerfile.scratch deleted file mode 100644 index 460586980..000000000 --- a/Dockerfile.scratch +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2017 by the contributors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM alpine:latest -RUN adduser -D -u 10000 aws-iam-authenticator -RUN apk add --update ca-certificates -COPY aws-iam-authenticator / -RUN chown aws-iam-authenticator /aws-iam-authenticator - -FROM scratch -COPY --from=0 /etc/passwd /etc/passwd -COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=0 /aws-iam-authenticator /aws-iam-authenticator -USER aws-iam-authenticator -ENTRYPOINT ["/aws-iam-authenticator"] diff --git a/Makefile b/Makefile index 1a52e93d3..2900fbc20 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,6 @@ build-all-bins: .PHONY: image image: docker buildx build --output=type=registry --platform linux/amd64,linux/arm64 \ - --build-arg image=public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-nonroot:2021-08-26-1630012071 \ --tag aws-iam-authenticator:$(VERSION)_$(GIT_COMMIT)_$(BUILD_DATE_STRIPPED) . .PHONY: goreleaser