From a48ec38f55d1eb31573151cdd088e9f205e3b9e7 Mon Sep 17 00:00:00 2001 From: Iryna Shustava Date: Tue, 26 Jul 2022 17:47:39 -0600 Subject: [PATCH] Remove unused dockerfiles --- .../build-support/docker/Dev.dockerfile | 2 - .../build-support/docker/Release.dockerfile | 70 ------------------ .../docker/Release.ubi.dockerfile | 72 ------------------- 3 files changed, 144 deletions(-) delete mode 100644 control-plane/build-support/docker/Dev.dockerfile delete mode 100644 control-plane/build-support/docker/Release.dockerfile delete mode 100644 control-plane/build-support/docker/Release.ubi.dockerfile diff --git a/control-plane/build-support/docker/Dev.dockerfile b/control-plane/build-support/docker/Dev.dockerfile deleted file mode 100644 index 3fc6842cad..0000000000 --- a/control-plane/build-support/docker/Dev.dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM hashicorp/consul-k8s-control-plane:latest -COPY pkg/bin/linux_amd64/consul-k8s-control-plane /bin diff --git a/control-plane/build-support/docker/Release.dockerfile b/control-plane/build-support/docker/Release.dockerfile deleted file mode 100644 index b782bd579b..0000000000 --- a/control-plane/build-support/docker/Release.dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -# This Dockerfile creates a production release image for the project. This -# downloads the release from releases.hashicorp.com and therefore requires that -# the release is published before building the Docker image. -# -# We don't rebuild the software because we want the exact checksums and -# binary signatures to match the software and our builds aren't fully -# reproducible currently. -FROM alpine:3.15 - -# NAME and VERSION are the name of the software in releases.hashicorp.com -# and the version to download. Example: NAME=consul VERSION=1.2.3. -ARG NAME -ARG VERSION - -LABEL name=$NAME \ - maintainer="Consul Team " \ - vendor="HashiCorp" \ - version=$VERSION \ - release=$VERSION \ - summary="consul-k8s-control-plane provides first-class integrations between Consul and Kubernetes." \ - description="consul-k8s-control-plane provides first-class integrations between Consul and Kubernetes." - -# Set ARGs as ENV so that they can be used in ENTRYPOINT/CMD -ENV NAME=$NAME -ENV VERSION=$VERSION - -# This is the location of the releases. -ENV HASHICORP_RELEASES=https://releases.hashicorp.com - -# Create a non-root user to run the software. -RUN addgroup ${NAME} && \ - adduser -S -G ${NAME} 100 - -# Set up certificates, base tools, and software. -RUN set -eux && \ - apk add --no-cache ca-certificates curl gnupg libcap openssl su-exec iputils libc6-compat iptables && \ - BUILD_GPGKEY=C874011F0AB405110D02105534365D9472D7468F; \ - found=''; \ - for server in \ - hkp://p80.pool.sks-keyservers.net:80 \ - hkp://keyserver.ubuntu.com:80 \ - hkp://pgp.mit.edu:80 \ - ; do \ - echo "Fetching GPG key $BUILD_GPGKEY from $server"; \ - gpg --keyserver "$server" --recv-keys "$BUILD_GPGKEY" && found=yes && break; \ - done; \ - test -z "$found" && echo >&2 "error: failed to fetch GPG key $BUILD_GPGKEY" && exit 1; \ - mkdir -p /tmp/build && \ - cd /tmp/build && \ - apkArch="$(apk --print-arch)" && \ - case "${apkArch}" in \ - aarch64) ARCH='arm64' ;; \ - armhf) ARCH='arm' ;; \ - x86) ARCH='386' ;; \ - x86_64) ARCH='amd64' ;; \ - *) echo >&2 "error: unsupported architecture: ${apkArch} (see ${HASHICORP_RELEASES}/${NAME}/${VERSION}/)" && exit 1 ;; \ - esac && \ - wget ${HASHICORP_RELEASES}/${NAME}/${VERSION}/${NAME}_${VERSION}_linux_${ARCH}.zip && \ - wget ${HASHICORP_RELEASES}/${NAME}/${VERSION}/${NAME}_${VERSION}_SHA256SUMS && \ - wget ${HASHICORP_RELEASES}/${NAME}/${VERSION}/${NAME}_${VERSION}_SHA256SUMS.sig && \ - gpg --batch --verify ${NAME}_${VERSION}_SHA256SUMS.sig ${NAME}_${VERSION}_SHA256SUMS && \ - grep ${NAME}_${VERSION}_linux_${ARCH}.zip ${NAME}_${VERSION}_SHA256SUMS | sha256sum -c && \ - unzip -d /bin ${NAME}_${VERSION}_linux_${ARCH}.zip && \ - cd /tmp && \ - rm -rf /tmp/build && \ - apk del gnupg openssl && \ - rm -rf /root/.gnupg - -USER 100 -CMD /bin/${NAME} diff --git a/control-plane/build-support/docker/Release.ubi.dockerfile b/control-plane/build-support/docker/Release.ubi.dockerfile deleted file mode 100644 index 95768a4c8d..0000000000 --- a/control-plane/build-support/docker/Release.ubi.dockerfile +++ /dev/null @@ -1,72 +0,0 @@ -# Dockerfile for consul-k8s with UBI as its base image. Used for running on -# OpenShift. -# -# This Dockerfile creates a production release image for the project. This -# downloads the release from releases.hashicorp.com and therefore requires that -# the release is published before building the Docker image. -# -# We don't rebuild the software because we want the exact checksums and -# binary signatures to match the software and our builds aren't fully -# reproducible currently. -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6 - -# NAME and VERSION are the name of the software in releases.hashicorp.com -# and the version to download. Example: NAME=consul VERSION=1.2.3. -ARG NAME -ARG VERSION - -LABEL name=$NAME \ - maintainer="Consul Team " \ - vendor="HashiCorp" \ - version=$VERSION \ - release=$VERSION \ - summary="consul-k8s-control-plane provides first-class integrations between Consul and Kubernetes." \ - description="consul-k8s-control-plane provides first-class integrations between Consul and Kubernetes." - -# Set ARGs as ENV so that they can be used in ENTRYPOINT/CMD -ENV NAME=$NAME -ENV VERSION=$VERSION - -# This is the location of the releases. -ENV HASHICORP_RELEASES=https://releases.hashicorp.com - -# Copy license for Red Hat certification. -COPY LICENSE.md /licenses/mozilla.txt - -# Set up certificates, base tools, and software. -RUN set -eux && \ - microdnf install -y ca-certificates curl gnupg libcap openssl wget unzip tar shadow-utils iptables && \ - BUILD_GPGKEY=C874011F0AB405110D02105534365D9472D7468F; \ - found=''; \ - for server in \ - hkp://p80.pool.sks-keyservers.net:80 \ - hkp://keyserver.ubuntu.com:80 \ - hkp://pgp.mit.edu:80 \ - ; do \ - echo "Fetching GPG key $BUILD_GPGKEY from $server"; \ - gpg --keyserver "$server" --recv-keys "$BUILD_GPGKEY" && found=yes && break; \ - done; \ - test -z "$found" && echo >&2 "error: failed to fetch GPG key $BUILD_GPGKEY" && exit 1; \ - mkdir -p /tmp/build && \ - cd /tmp/build && \ - ARCH=amd64 && \ - wget ${HASHICORP_RELEASES}/${NAME}/${VERSION}/${NAME}_${VERSION}_linux_${ARCH}.zip && \ - wget ${HASHICORP_RELEASES}/${NAME}/${VERSION}/${NAME}_${VERSION}_SHA256SUMS && \ - wget ${HASHICORP_RELEASES}/${NAME}/${VERSION}/${NAME}_${VERSION}_SHA256SUMS.sig && \ - gpg --batch --verify ${NAME}_${VERSION}_SHA256SUMS.sig ${NAME}_${VERSION}_SHA256SUMS && \ - grep ${NAME}_${VERSION}_linux_${ARCH}.zip ${NAME}_${VERSION}_SHA256SUMS | sha256sum -c && \ - unzip -d /bin ${NAME}_${VERSION}_linux_${ARCH}.zip && \ - cd /tmp && \ - rm -rf /tmp/build && \ - gpgconf --kill all && \ - rm -rf /root/.gnupg - -# Create a non-root user to run the software. On OpenShift, this -# will not matter since the container is run as a random user and group -# but this is kept for consistency with our other images. -RUN groupadd --gid 1000 ${NAME} && \ - adduser --uid 100 --system -g ${NAME} ${NAME} && \ - usermod -a -G root ${NAME} - -USER 100 -CMD /bin/${NAME}