From 1443fd0d6576e521a62250de8496634ebdc15694 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Tue, 16 Jan 2018 09:21:08 -0600 Subject: [PATCH] Split Dockerfiles into scratch, alpine, and debian versions. Signed-off-by: Matt Moyer --- .goreleaser.yaml | 34 +++++++++++++++++++++++++++++++- Dockerfile.alpine-3.6 | 20 +++++++++++++++++++ Dockerfile.alpine-3.7 | 20 +++++++++++++++++++ Dockerfile.debian-jessie | 28 ++++++++++++++++++++++++++ Dockerfile.debian-stretch | 28 ++++++++++++++++++++++++++ Dockerfile => Dockerfile.scratch | 0 6 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.alpine-3.6 create mode 100644 Dockerfile.alpine-3.7 create mode 100644 Dockerfile.debian-jessie create mode 100644 Dockerfile.debian-stretch rename Dockerfile => Dockerfile.scratch (100%) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index cea3bd141..035cae46e 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,6 +14,38 @@ builds: dockers: - image: gcr.io/heptio-images/authenticator + binary: heptio-authenticator-aws + dockerfile: Dockerfile.scratch + tag_templates: + - "{{ .Tag }}-scratch" + - "{{ .Tag }}" + latest: false + - image: gcr.io/heptio-images/authenticator + binary: heptio-authenticator-aws + dockerfile: Dockerfile.alpine-3.6 + tag_templates: + - "{{ .Tag }}-alpine-3.6" + latest: false + - image: gcr.io/heptio-images/authenticator + binary: heptio-authenticator-aws + dockerfile: Dockerfile.alpine-3.7 + tag_templates: + - "{{ .Tag }}-alpine-3.7" + - "{{ .Tag }}-alpine" + latest: false + - image: gcr.io/heptio-images/authenticator + binary: heptio-authenticator-aws + dockerfile: Dockerfile.debian-jessie + tag_templates: + - "{{ .Tag }}-debian-jessie" + latest: false + - image: gcr.io/heptio-images/authenticator + binary: heptio-authenticator-aws + dockerfile: Dockerfile.debian-stretch + tag_templates: + - "{{ .Tag }}-debian-stretch" + - "{{ .Tag }}-debian" + latest: false snapshot: name_template: "git-{{.Commit}}" @@ -27,4 +59,4 @@ release: name: authenticator draft: true prerelease: true - name_template: "v{{.Version}}" \ No newline at end of file + name_template: "v{{.Version}}" diff --git a/Dockerfile.alpine-3.6 b/Dockerfile.alpine-3.6 new file mode 100644 index 000000000..871c64473 --- /dev/null +++ b/Dockerfile.alpine-3.6 @@ -0,0 +1,20 @@ +# 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.6 +RUN adduser -D -u 10000 heptio-authenticator-aws +RUN apk add --update ca-certificates +COPY heptio-authenticator-aws / +USER heptio-authenticator-aws +ENTRYPOINT ["/heptio-authenticator-aws"] diff --git a/Dockerfile.alpine-3.7 b/Dockerfile.alpine-3.7 new file mode 100644 index 000000000..1a9608033 --- /dev/null +++ b/Dockerfile.alpine-3.7 @@ -0,0 +1,20 @@ +# 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 heptio-authenticator-aws +RUN apk add --update ca-certificates +COPY heptio-authenticator-aws / +USER heptio-authenticator-aws +ENTRYPOINT ["/heptio-authenticator-aws"] diff --git a/Dockerfile.debian-jessie b/Dockerfile.debian-jessie new file mode 100644 index 000000000..f44b6c674 --- /dev/null +++ b/Dockerfile.debian-jessie @@ -0,0 +1,28 @@ +# 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 \ + heptio-authenticator-aws && \ + apt-get update && \ + apt-get install -y ca-certificates && \ + rm -rf /var/lib/apt/lists/* +COPY heptio-authenticator-aws / +USER heptio-authenticator-aws +ENTRYPOINT ["/heptio-authenticator-aws"] diff --git a/Dockerfile.debian-stretch b/Dockerfile.debian-stretch new file mode 100644 index 000000000..4695556c3 --- /dev/null +++ b/Dockerfile.debian-stretch @@ -0,0 +1,28 @@ +# 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 \ + heptio-authenticator-aws && \ + apt-get update && \ + apt-get install -y ca-certificates && \ + rm -rf /var/lib/apt/lists/* +COPY heptio-authenticator-aws / +USER heptio-authenticator-aws +ENTRYPOINT ["/heptio-authenticator-aws"] diff --git a/Dockerfile b/Dockerfile.scratch similarity index 100% rename from Dockerfile rename to Dockerfile.scratch