Skip to content

ci: Alpine Linux Docker image (musl) #4190

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

Merged
merged 1 commit into from
May 17, 2025
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
42 changes: 42 additions & 0 deletions .github/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# docker build --build-arg BASE=alpine:3.21
ARG BASE=alpine:latest
FROM ${BASE}

RUN apk update

# common
RUN apk add bash build-base cmake curl git icu lsb-release-minimal sudo tar wget

# sentry-native
RUN apk add curl-dev libunwind-dev libunwind-static linux-headers openssl-dev zlib-dev xz-dev

# sentry-dotnet
RUN apk add grpc-plugins openjdk11 powershell
ENV PROTOBUF_PROTOC=/usr/bin/protoc
ENV GRPC_PROTOC_PLUGIN=/usr/bin/grpc_csharp_plugin
RUN pwsh -Command Install-Module Pester -Scope AllUsers -Force

# mono (3.22+)
RUN if ! apk add mono; then \
sed -i.bak 's|/v3\.[0-9]\+|/edge|g' /etc/apk/repositories && \
cat /etc/apk/repositories && \
apk update && \
apk add --no-cache mono && \
mv /etc/apk/repositories.bak /etc/apk/repositories && \
apk update; \
fi
RUN mono --version

# runner
RUN addgroup runner
RUN adduser -S -u 1001 -h /home/runner -G runner runner
RUN mkdir -p /home/runner /__e /__w /__w/_temp /__w/_actions /__w/_tool
RUN chown -R runner:runner /home/runner /__e /__w
RUN ln -s /__w /home/runner/work
RUN echo "runner ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/runner
RUN chmod 0440 /etc/sudoers.d/runner
RUN chmod -R 777 /opt
RUN chmod -R 777 /usr/share
USER runner
WORKDIR /__w
ENTRYPOINT ["/bin/bash"]
38 changes: 38 additions & 0 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Alpine Linux Docker image

on:
workflow_dispatch:
push:
paths:
- '.github/alpine/*'

jobs:
build:
name: Build sentry-dotnet-alpine:${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "3.21"

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build ghcr.io/${{ github.repository_owner }}/sentry-dotnet-alpine:${{ matrix.version }}
run: docker build --build-arg BASE=alpine:${{ matrix.version }} -t ghcr.io/${{ github.repository_owner }}/sentry-dotnet-alpine:${{ matrix.version }} .
working-directory: .github/alpine

- name: Push ghcr.io/${{ github.repository_owner }}/sentry-dotnet-alpine:${{ matrix.version }}
run: docker push ghcr.io/${{ github.repository_owner }}/sentry-dotnet-alpine:${{ matrix.version }}
working-directory: .github/alpine
Loading