Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit 2f1c59f

Browse files
authored
release: build multi-arch docker image (#50)
* release: build multi-arch docker image * docker: add entrypoint that mounts debugfs if it's not mounted
1 parent 63744cd commit 2f1c59f

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,37 @@ jobs:
1212

1313
release:
1414
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: datadog/otel-profiling-agent
1517
RELEASE_VERSION: ${{ github.ref_name }}
1618
needs: build
1719
name: Release
1820
runs-on: ubuntu-24.04
1921
permissions:
2022
actions: read
2123
contents: write
24+
packages: write
2225
steps:
26+
- name: Check out
27+
uses: actions/checkout@v4
28+
- name: Setup buildx
29+
uses: docker/setup-buildx-action@v3
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Extract metadata (tags, labels) for Docker
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
env:
40+
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
annotations: |
44+
org.opencontainers.image.description=The Datadog OpenTelemetry Profiling Agent is a full-host profiler that collects and sends profiling data to Datadog
45+
org.opencontainers.image.vendor=Datadog
2346
- name: Download artifacts
2447
uses: actions/download-artifact@v4
2548
- name: Create assets
@@ -35,3 +58,12 @@ jobs:
3558
omitBody: true
3659
draft: true
3760
tag: ${{ env.RELEASE_VERSION }}
61+
- name: Build and push Docker image
62+
uses: docker/build-push-action@v6
63+
with:
64+
context: .
65+
file: docker/Dockerfile.release
66+
platforms: linux/amd64,linux/arm64
67+
push: true
68+
tags: ${{ steps.meta.outputs.tags }}
69+
annotations: ${{ steps.meta.outputs.annotations }}

docker/Dockerfile.release

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# syntax=docker.io/docker/dockerfile:1.7-labs
2+
FROM ubuntu:24.04
3+
4+
RUN apt-get update && \
5+
apt-get install -y --no-install-recommends binutils ca-certificates
6+
7+
COPY docker/entrypoint.sh /entrypoint.sh
8+
COPY --parents agent-** /tmp/
9+
10+
RUN mv /tmp/agent-$(uname -p)/otel-profiling-agent /usr/local/bin/otel-profiling-agent \
11+
&& chmod +x /usr/local/bin/otel-profiling-agent \
12+
&& rm -rf /tmp/agent*
13+
14+
RUN apt-get clean && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
ENTRYPOINT ["/entrypoint.sh"]
18+
CMD ["/usr/local/bin/otel-profiling-agent"]

docker/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /usr/bin/env sh
2+
set -e
3+
4+
# Wrapper to ensure debugfs is mounted
5+
6+
# Mount debugfs if not already mounted
7+
if [ ! -d /sys/kernel/debug/tracing ]; then
8+
mount -t debugfs none /sys/kernel/debug
9+
fi
10+
11+
exec "$@"

0 commit comments

Comments
 (0)