Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build and push dotnet-auto-instrumentation image #989

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/publish-autoinstrumentation-dotnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "Publish DotNet Auto-Instrumentation"

on:
push:
paths:
- 'autoinstrumentation/dotnet/**'
- '.github/workflows/publish-autoinstrumentation-dotnet.yaml'
branches:
- main
pull_request:
paths:
- 'autoinstrumentation/dotnet/**'
- '.github/workflows/publish-autoinstrumentation-dotnet.yaml'
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Read version
run: echo "VERSION=$(cat autoinstrumentation/dotnet/version.txt)" >> $GITHUB_ENV

- name: Docker meta
id: meta
uses: docker/metadata-action@v4.0.1
with:
images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet
tags: |
type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Package Registry
uses: docker/login-action@v2.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3.0.0
with:
context: autoinstrumentation/dotnet
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' }}
build-args: version=${{ env.VERSION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
20 changes: 20 additions & 0 deletions autoinstrumentation/dotnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To build one auto-instrumentation image for dotnet, please:
# - Download your dotnet auto-instrumentation artefacts to `/autoinstrumentation` directory. This is required as when instrumenting the pod,
# one init container will be created to copy the files to your app's container.
# - Grant the necessary access to the files in the `/autoinstrumentation` directory.
# - Following environment variables are injected to the application container to enable the auto-instrumentation.
# DOTNET_ADDITIONAL_DEPS=%InstallationLocation%/AdditionalDeps
# DOTNET_SHARED_STORE=%InstallationLocation%/store
# DOTNET_STARTUP_HOOKS=%InstallationLocation%/netcoreapp3.1/OpenTelemetry.AutoInstrumentation.StartupHook.dll

FROM busybox

ARG version

WORKDIR /autoinstrumentation

ADD https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/download/v$version/opentelemetry-dotnet-instrumentation-linux-glibc.zip .

RUN unzip opentelemetry-dotnet-instrumentation-linux-glibc.zip

RUN chmod -R go+r .
1 change: 1 addition & 0 deletions autoinstrumentation/dotnet/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.0-beta.1