From fdcd0addbcdd40ea41ae57dc71b1eadf9c1b2535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20=C5=9Awi=C4=85tek?= Date: Mon, 26 Jun 2023 15:39:08 +0200 Subject: [PATCH] feat(build): make dev builds identical to release builds --- .github/workflows/dev_builds.yml | 4 ++-- Dockerfile_dev | 37 -------------------------------- Makefile | 24 --------------------- 3 files changed, 2 insertions(+), 63 deletions(-) delete mode 100644 Dockerfile_dev diff --git a/.github/workflows/dev_builds.yml b/.github/workflows/dev_builds.yml index 860eac3daf..8df271b8a1 100644 --- a/.github/workflows/dev_builds.yml +++ b/.github/workflows/dev_builds.yml @@ -153,7 +153,7 @@ jobs: if: matrix.arch_os == 'linux_amd64' run: | cp otelcol-sumo-fips-${{ matrix.arch_os }} otelcol-sumo - make build-push-container-multiplatform-dev \ + make build-push-container-multiplatform \ BUILD_TAG=${{ steps.extract_tag.outputs.tag }}-fips \ PLATFORM=${{ matrix.arch_os }} \ LATEST_TAG_FIPS_SUFFIX="-fips" @@ -166,7 +166,7 @@ jobs: - name: Build and push image to Open Source ECR run: | cp otelcol-sumo-${{ matrix.arch_os }} otelcol-sumo - make build-push-container-multiplatform-dev \ + make build-push-container-multiplatform \ BUILD_TAG=${{ steps.extract_tag.outputs.tag }} \ PLATFORM=${{ matrix.arch_os }} diff --git a/Dockerfile_dev b/Dockerfile_dev deleted file mode 100644 index 7c8c23b5e6..0000000000 --- a/Dockerfile_dev +++ /dev/null @@ -1,37 +0,0 @@ -FROM alpine:3.18.2 as otelcol -COPY otelcol-sumo / -# This shouldn't be necessary but sometimes we end up with execution bit not set. -# ref: https://github.com/open-telemetry/opentelemetry-collector/issues/1317 -RUN chmod 755 /otelcol-sumo - -FROM alpine:3.18.2 as certs -RUN apk --update add ca-certificates - -FROM alpine:3.18.2 as directories -RUN mkdir /etc/otel/ - -FROM debian:11.7 as systemd -RUN apt update && apt install -y systemd -# prepare package with journald and it's dependencies keeping original paths -# h stands for dereference of symbolic links -RUN tar czhf journalctl.tar.gz /bin/journalctl $(ldd /bin/journalctl | grep -oP "\/.*? ") - -FROM golang:1.20.5 -ARG BUILD_TAG=latest -ENV TAG $BUILD_TAG -ARG USER_UID=10001 -USER ${USER_UID} -ENV HOME /etc/otel/ - -COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=otelcol /otelcol-sumo /otelcol-sumo -COPY --from=directories --chown=${USER_UID}:${USER_UID} /etc/otel/ /etc/otel/ - -# copy and extract journald with dependencies -COPY --from=systemd --chown=${USER_UID}:${USER_UID} /journalctl.tar.gz /journalctl.tar.gz -USER root -RUN tar xf /journalctl.tar.gz --directory / && rm /journalctl.tar.gz -USER ${USER_UID} - -ENTRYPOINT ["/otelcol-sumo"] -CMD ["--config", "/etc/otel/config.yaml"] diff --git a/Makefile b/Makefile index 8d2f4859c4..622283bb53 100644 --- a/Makefile +++ b/Makefile @@ -254,30 +254,6 @@ build-container-dev: #------------------------------------------------------------------------------- -# dev - -.PHONY: _build-container-multiplatform-dev -_build-container-multiplatform-dev: - BUILD_TAG="$(BUILD_TAG)" \ - REPO_URL="$(OPENSOURCE_REPO_URL_DEV)" \ - DOCKERFILE="Dockerfile_dev" \ - PLATFORM="$(PLATFORM)" \ - ./ci/build-push-multiplatform.sh $(PUSH) - -.PHONY: build-container-multiplatform-dev -build-container-multiplatform-dev: - $(MAKE) _build-container-multiplatform-dev PUSH= - -.PHONY: build-container-multiplatform-dev -build-push-container-multiplatform-dev: - $(MAKE) _build-container-multiplatform-dev PUSH=--push - -.PHONY: push-container-manifest-dev -push-container-manifest-dev: - BUILD_TAG="$(BUILD_TAG)" \ - REPO_URL="$(OPENSOURCE_REPO_URL_DEV)" \ - ./ci/push_docker_multiplatform_manifest.sh $(PLATFORMS) - # release .PHONY: _build-container-multiplatform