From c5a4fdfcce38f3b8de755559ea7e6466264346a3 Mon Sep 17 00:00:00 2001 From: Marcin Dobrochowski Date: Fri, 23 Feb 2024 16:35:05 +0100 Subject: [PATCH] remove unused operator dockerfiles --- components/operator/Dockerfile.dev | 60 -------------------------- components/operator/Dockerfile.release | 60 -------------------------- 2 files changed, 120 deletions(-) delete mode 100644 components/operator/Dockerfile.dev delete mode 100644 components/operator/Dockerfile.release diff --git a/components/operator/Dockerfile.dev b/components/operator/Dockerfile.dev deleted file mode 100644 index 862974b42..000000000 --- a/components/operator/Dockerfile.dev +++ /dev/null @@ -1,60 +0,0 @@ -# TODO: This is exact copy of "Dockerfile" because test-infra use "Dockerfile.dev" - remove this after changes in test-infra - -# -# This Dockerfile is used to build serverless-operator image on every pre- and post-submit job -# - - -# Build the operator binary -FROM golang:1.22.0 as builder - -WORKDIR /workspace - -# Copy the Go Modules manifests -COPY go.mod go.sum ./ - -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -COPY components/operator components/operator - -# Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o operator ./components/operator/main.go - - -# Replace main images in values.yaml -# Bumping serverless images in the values.yaml - used for building "local" and "dev" images -FROM alpine:3.19.1 as replacer - -WORKDIR /workspace - -ARG PURPOSE -ARG IMG_DIRECTORY -ARG IMG_VERSION - -ENV IMG_DIRECTORY=$IMG_DIRECTORY -ENV IMG_VERSION=$IMG_VERSION - -RUN apk update && apk add make yq - -COPY components/operator/hack components/operator/hack -COPY config/serverless config/serverless -COPY hack/ hack/ - -RUN if [[ "dev" = "$PURPOSE" ]] ; then make -C components/operator/hack/ci replace-function-chart-images ; fi -RUN if [[ "local" = "$PURPOSE" ]] ; then make -C components/operator/hack/ci replace-only-main-chart-images ; fi -# do nothing (keep unchanged versions) for "release" - - -# Use distroless as minimal base image to package the operator binary -# Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot - -WORKDIR / -COPY --chown=65532:65532 --from=builder /workspace/operator . -COPY --chown=65532:65532 --from=replacer /workspace/config/serverless /module-chart -USER 65532:65532 - -ENTRYPOINT ["/operator"] diff --git a/components/operator/Dockerfile.release b/components/operator/Dockerfile.release deleted file mode 100644 index 7d4d6cd55..000000000 --- a/components/operator/Dockerfile.release +++ /dev/null @@ -1,60 +0,0 @@ -# TODO: This is exact copy of "Dockerfile" because test-infra use "Dockerfile.release" - remove this after changes in test-infra - -# -# This Dockerfile is used to build serverless-operator image on every pre- and post-submit job -# - - -# Build the operator binary -FROM golang:1.22.0 as builder - -WORKDIR /workspace - -# Copy the Go Modules manifests -COPY go.mod go.sum ./ - -# cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN go mod download - -# Copy the go source -COPY components/operator components/operator - -# Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o operator ./components/operator/main.go - - -# Replace main images in values.yaml -# Bumping serverless images in the values.yaml - used for building "local" and "dev" images -FROM alpine:3.19.1 as replacer - -WORKDIR /workspace - -ARG PURPOSE -ARG IMG_DIRECTORY -ARG IMG_VERSION - -ENV IMG_DIRECTORY=$IMG_DIRECTORY -ENV IMG_VERSION=$IMG_VERSION - -RUN apk update && apk add make yq - -COPY components/operator/hack components/operator/hack -COPY config/serverless config/serverless -COPY hack/ hack/ - -RUN if [[ "dev" = "$PURPOSE" ]] ; then make -C components/operator/hack/ci replace-function-chart-images ; fi -RUN if [[ "local" = "$PURPOSE" ]] ; then make -C components/operator/hack/ci replace-only-main-chart-images ; fi -# do nothing (keep unchanged versions) for "release" - - -# Use distroless as minimal base image to package the operator binary -# Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot - -WORKDIR / -COPY --chown=65532:65532 --from=builder /workspace/operator . -COPY --chown=65532:65532 --from=replacer /workspace/config/serverless /module-chart -USER 65532:65532 - -ENTRYPOINT ["/operator"]