From b7cc2bcd3614eb79bceb4e1ea7a44afc6c0316c9 Mon Sep 17 00:00:00 2001 From: Ashley Jeffs Date: Fri, 22 Nov 2024 17:44:23 +0000 Subject: [PATCH] Remove cgo builds (#3030) * Remove cgo builds * Add command to CL entry --- .github/workflows/docker_edge.yml | 7 ----- .github/workflows/release.yml | 7 +---- CHANGELOG.md | 4 +++ Makefile | 9 +----- resources/docker/Dockerfile.cgo | 50 ------------------------------- 5 files changed, 6 insertions(+), 71 deletions(-) delete mode 100644 resources/docker/Dockerfile.cgo diff --git a/.github/workflows/docker_edge.yml b/.github/workflows/docker_edge.yml index c568333ac7..60cdb28f29 100644 --- a/.github/workflows/docker_edge.yml +++ b/.github/workflows/docker_edge.yml @@ -71,10 +71,3 @@ jobs: push: true tags: redpandadata/connect:edge-cloud - - name: Build and push CGO - uses: docker/build-push-action@v6 - with: - context: ./ - file: ./resources/docker/Dockerfile.cgo - push: true - tags: redpandadata/connect:edge-cgo diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44baff7c56..9245047abf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,11 +80,6 @@ jobs: suffix: "" platform: linux/amd64,linux/arm64 file: ./resources/docker/Dockerfile - - flavor: cgo - latest: false - suffix: -cgo - platform: linux/amd64 - file: ./resources/docker/Dockerfile.cgo - flavor: cloud latest: false suffix: -cloud @@ -138,7 +133,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Write telemetry private key - if: ${{ matrix.suffix == '' || matrix.suffix == '-cgo' }} + if: ${{ matrix.suffix == '' }} env: CONNECT_TELEMETRY_PRIV_KEY: ${{ secrets.TELEMETRY_PRIVATE_KEY }} run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8839501a..4bb842d689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file. - Field `max_records_per_request` added to the `aws_sqs` output. (@Jeffail) +### Changed + +- The `-cgo` suffixed docker images are no longer built and pushed along with the regular images. This decision was made due to low demand, and the unacceptable cadence with which the image base (Debian) receives security updates. It is still possible to create your own CGO builds with the command `CGO_ENABLED=1 make TAGS=x_benthos_extra redpanda-connect`. + ## 4.40.0 - 2024-11-21 ### Added diff --git a/Makefile b/Makefile index 6a0f58da51..5f831501b8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all deps docker docker-cgo clean test test-race test-integration fmt lint install +.PHONY: all deps docker clean test test-race test-integration fmt lint install TAGS ?= @@ -48,9 +48,6 @@ docker-tags: docker-rc-tags: @echo "latest,$(VER_CUT),$(VER_MAJOR)-$(VER_RC)" > .tags -docker-cgo-tags: - @echo "latest-cgo,$(VER_CUT)-cgo,$(VER_MAJOR).$(VER_MINOR)-cgo,$(VER_MAJOR)-cgo" > .tags - docker: @docker build -f ./resources/docker/Dockerfile . -t $(DOCKER_IMAGE):$(VER_CUT) @docker tag $(DOCKER_IMAGE):$(VER_CUT) $(DOCKER_IMAGE):latest @@ -63,10 +60,6 @@ docker-ai: @docker build -f ./resources/docker/Dockerfile.ai . -t $(DOCKER_IMAGE):$(VER_CUT)-ai @docker tag $(DOCKER_IMAGE):$(VER_CUT)-ai $(DOCKER_IMAGE):latest-ai -docker-cgo: - @docker build -f ./resources/docker/Dockerfile.cgo . -t $(DOCKER_IMAGE):$(VER_CUT)-cgo - @docker tag $(DOCKER_IMAGE):$(VER_CUT)-cgo $(DOCKER_IMAGE):latest-cgo - fmt: @go list -f {{.Dir}} ./... | xargs -I{} gofmt -w -s {} @go list -f {{.Dir}} ./... | xargs -I{} goimports -w -local github.com/redpanda-data/connect/v4 {} diff --git a/resources/docker/Dockerfile.cgo b/resources/docker/Dockerfile.cgo deleted file mode 100644 index 4a7f035a16..0000000000 --- a/resources/docker/Dockerfile.cgo +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2024 Redpanda Data, Inc. -# -# 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 golang:1.22 AS build - -ENV CGO_ENABLED=1 -ENV GOOS=linux - -WORKDIR /go/src/github.com/redpanda-data/connect/ -# Update dependencies: On unchanged dependencies, cached layer will be reused -COPY go.* /go/src/github.com/redpanda-data/connect/ -RUN go mod download - -RUN apt-get update && apt-get install -y --no-install-recommends libzmq3-dev - -# Build -COPY . /go/src/github.com/redpanda-data/connect/ - -RUN make TAGS=x_benthos_extra redpanda-connect - -# Pack -FROM debian:latest - -LABEL maintainer="Ashley Jeffs " -LABEL org.opencontainers.image.source="https://github.com/redpanda-data/connect" - -WORKDIR /root/ - -RUN apt-get update && apt-get install -y --no-install-recommends libzmq3-dev - -COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=build /go/src/github.com/redpanda-data/connect/target/bin/redpanda-connect . -COPY ./config/docker.yaml /connect.yaml - -EXPOSE 4195 - -ENTRYPOINT ["./redpanda-connect"] - -CMD ["run", "/connect.yaml"]