Skip to content

Commit

Permalink
Update Docker Workflow and Add C#
Browse files Browse the repository at this point in the history
  • Loading branch information
jesforge authored Apr 18, 2024
1 parent 84120c6 commit d1dd7b1
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/docker-publish-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Docker Image

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- main
paths:
- runtimes/dotnet/**
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
push:
name: "dotnet:${{ matrix.tag }}"
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
strategy:
fail-fast: false
matrix:
tag:
- 5
- 6
- 7
- 8

steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug

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

- uses: docker/build-push-action@v5
with:
context: runtimes/dotnet
file: runtimes/dotnet/${{ matrix.tag }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/tnsstudio-hq/moonlightdockerimages:dotnet${{ matrix.tag }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
push:
branches:
- main
paths:
- runtimes/nodejs/**
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Expand Down
25 changes: 25 additions & 0 deletions runtimes/dotnet/5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM --platform=$TARGETOS/$TARGETARCH debian:latest

LABEL author="Jesper Richert" maintainer="[email protected]"

ENV DEBIAN_FRONTEND noninteractive

RUN apt update -y \
&& apt upgrade -y \
&& apt install -y apt-transport-https wget curl iproute2 libgdiplus tini \
&& wget https://dot.net/v1/dotnet-install.sh \
&& D_V="$(curl -sSL https://dotnet.microsoft.com/en-us/download/dotnet/5.0 | grep -i '<h3 id="sdk-5.*">SDK 5.*.*</h3>' | head -1 | awk -F\" '{print $3}' | awk '{print $2;}' | sed 's/<\/h3>//g')" \
&& chmod +x dotnet-install.sh \
&& ./dotnet-install.sh -i /usr/share -v $D_V \
&& ln -s /usr/share/dotnet /usr/bin/dotnet

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
25 changes: 25 additions & 0 deletions runtimes/dotnet/6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM --platform=$TARGETOS/$TARGETARCH debian:latest

LABEL author="Jesper Richert" maintainer="[email protected]"

ENV DEBIAN_FRONTEND noninteractive

RUN apt update -y \
&& apt upgrade -y \
&& apt install -y apt-transport-https wget curl iproute2 libgdiplus tini \
&& wget https://dot.net/v1/dotnet-install.sh \
&& D_V="$(curl -sSL https://dotnet.microsoft.com/en-us/download/dotnet/6.0 | grep -i '<h3 id="sdk-6.*">SDK 6.*.*</h3>' | head -1 | awk -F\" '{print $3}' | awk '{print $2;}' | sed 's/<\/h3>//g')" \
&& chmod +x dotnet-install.sh \
&& ./dotnet-install.sh -i /usr/share -v $D_V \
&& ln -s /usr/share/dotnet /usr/bin/dotnet

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
25 changes: 25 additions & 0 deletions runtimes/dotnet/7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM --platform=$TARGETOS/$TARGETARCH debian:latest

LABEL author="Jesper Richert" maintainer="[email protected]"

ENV DEBIAN_FRONTEND noninteractive

RUN apt update -y \
&& apt upgrade -y \
&& apt install -y apt-transport-https wget curl iproute2 libgdiplus tini \
&& wget https://dot.net/v1/dotnet-install.sh \
&& D_V="$(curl -sSL https://dotnet.microsoft.com/en-us/download/dotnet/7.0 | grep -i '<h3 id="sdk-7.*">SDK 7.*.*</h3>' | head -1 | awk -F\" '{print $3}' | awk '{print $2;}' | sed 's/<\/h3>//g')" \
&& chmod +x dotnet-install.sh \
&& ./dotnet-install.sh -i /usr/share -v $D_V \
&& ln -s /usr/share/dotnet /usr/bin/dotnet

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]
25 changes: 25 additions & 0 deletions runtimes/dotnet/8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM --platform=$TARGETOS/$TARGETARCH debian:latest

LABEL author="Jesper Richert" maintainer="[email protected]"

ENV DEBIAN_FRONTEND noninteractive

RUN apt update -y \
&& apt upgrade -y \
&& apt install -y apt-transport-https wget curl iproute2 libgdiplus tini \
&& wget https://dot.net/v1/dotnet-install.sh \
&& D_V="$(curl -sSL https://dotnet.microsoft.com/en-us/download/dotnet/8.0 | grep -i '<h3 id="sdk-8.*">SDK 8.*.*</h3>' | head -1 | awk -F\" '{print $3}' | awk '{print $2;}' | sed 's/<\/h3>//g')" \
&& chmod +x dotnet-install.sh \
&& ./dotnet-install.sh -i /usr/share -v $D_V \
&& ln -s /usr/share/dotnet /usr/bin/dotnet

USER container
ENV USER=container HOME=/home/container
WORKDIR /home/container

STOPSIGNAL SIGINT

COPY --chown=container:container ../entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
CMD ["/entrypoint.sh"]

0 comments on commit d1dd7b1

Please sign in to comment.