Skip to content

Commit

Permalink
release: build multi-arch docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Gandem committed Aug 12, 2024
1 parent 63744cd commit 4f3a029
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,20 @@ jobs:
needs: [build]
runs-on: ubuntu-24.04
steps:
- name: Check out
uses: actions/checkout@v4
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: Create assets
run: |
tar czf otel-profiling-agent-${RELEASE_VERSION}-aarch64.tar.gz -C agent-aarch64 .
Expand Down Expand Up @@ -305,3 +317,6 @@ jobs:
prerelease: true
draft: false
tag: ${{ env.RELEASE_VERSION }}
- name: Build and push container image
run: |
docker buildx build --push -f Dockerfile.release --platform linux/amd64,linux/arm64 -t ghcr.io/datadog/otel-profiling-agent:${{ env.RELEASE_VERSION }} .
18 changes: 18 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# syntax=docker.io/docker/dockerfile:1.7-labs
FROM ubuntu:24.04

USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends binutils curl sudo ca-certificates

COPY --parents agent-** /tmp/

RUN mv /tmp/agent-$(uname -p)/otel-profiling-agent /usr/local/bin/otel-profiling-agent \
&& chmod +x /usr/local/bin/otel-profiling-agent \
&& rm -rf /tmp/agent*

RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*

CMD ["/bin/sh", "-c", "sudo -E /usr/local/bin/otel-profiling-agent"]

0 comments on commit 4f3a029

Please sign in to comment.