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 9809eaa
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,24 @@ jobs:
name: Publish pre-release
needs: [build]
runs-on: ubuntu-24.04
permissions:
packages: write
attestations: write
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 +320,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 9809eaa

Please sign in to comment.