From e297a75ac64cc1e49e63878879726dec78ba729a Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 7 Jan 2025 08:09:42 +0100 Subject: [PATCH] docker: build and push docker builder image (#297) Signed-off-by: Florian Lehner --- .github/workflows/push-docker-image.yml | 36 +++++++++++++++++++++++++ Dockerfile | 2 +- Makefile | 4 +-- 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/push-docker-image.yml diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml new file mode 100644 index 00000000..451990bc --- /dev/null +++ b/.github/workflows/push-docker-image.yml @@ -0,0 +1,36 @@ +name: "Update builder docker image" + +on: + push: + branches: ["main"] + paths: + - "Dockerfile" + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up environment + uses: ./.github/workflows/env + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Set current timestamp tag + id: tag + run: | + echo "tag=$(date +%Y%m%d%H%M)" >> $GITHUB_OUTPUT + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + file: Dockerfile + platforms: linux/amd64,linux/arm64 + tags: otel/opentelemetry-ebpf-profiler-dev:latest,otel/opentelemetry-ebpf-profiler-dev:${{ steps.tag.outputs.tag }} diff --git a/Dockerfile b/Dockerfile index c3f00632..ad50a242 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:testing +FROM debian:testing-20241223-slim WORKDIR /agent diff --git a/Makefile b/Makefile index 8b76dcbf..b8de7c91 100644 --- a/Makefile +++ b/Makefile @@ -119,11 +119,11 @@ docker-image: docker build -t profiling-agent -f Dockerfile . agent: - docker run -v "$$PWD":/agent -it --rm --user $(shell id -u):$(shell id -g) profiling-agent \ + docker run -v "$$PWD":/agent -it --rm --user $(shell id -u):$(shell id -g) otel/opentelemetry-ebpf-profiler-dev:latest \ "make TARGET_ARCH=$(TARGET_ARCH) VERSION=$(VERSION) REVISION=$(REVISION) BUILD_TIMESTAMP=$(BUILD_TIMESTAMP)" debug-agent: - docker run -v "$$PWD":/agent -it --rm --user $(shell id -u):$(shell id -g) profiling-agent \ + docker run -v "$$PWD":/agent -it --rm --user $(shell id -u):$(shell id -g) otel/opentelemetry-ebpf-profiler-dev:latest \ "make TARGET_ARCH=$(TARGET_ARCH) VERSION=$(VERSION) REVISION=$(REVISION) BUILD_TIMESTAMP=$(BUILD_TIMESTAMP) debug" legal: