Skip to content

Commit

Permalink
Add dotnet-3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hwalker928 authored Apr 6, 2024
1 parent b9c40ce commit 4fce2a7
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/dotnet-3.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build dotnet-3.1
on:
push:
branches:
- main
paths:
- dotnet/dotnet-3.1/*
- dotnet/entrypoint.sh
- .github/workflows/dotnet-3.1.yml
jobs:
push:
name: "dotnet-3.1"
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
with:
version: "v0.9.1"
buildkitd-flags: --debug
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: ./dotnet
file: ./dotnet/dotnet-3.1/Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/sparkedhost/images:dotnet-3.1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

### .NET images

- [`dotnet-3.1`](https://github.com/sparkedhost/images/blob/main/dotnet/dotnet-3.1/Dockerfile)
- [`dotnet-7`](https://github.com/sparkedhost/images/blob/main/dotnet/dotnet-7/Dockerfile)
- [`dotnet-8`](https://github.com/sparkedhost/images/blob/main/dotnet/dotnet-8/Dockerfile)

Expand Down
29 changes: 29 additions & 0 deletions dotnet/dotnet-3.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ----------------------------------
# Sparked Host Custom Image
# Image: ghcr.io/sparkedhost/images:dotnet-3.1
# ----------------------------------

FROM debian:bullseye-slim

LABEL author="DevOps Team at Sparked Host" maintainer="[email protected]"

ENV DEBIAN_FRONTEND noninteractive

RUN apt update -y \
&& apt install -y apt-transport-https wget curl iproute2 libgdiplus tini libssl-dev \
&& wget https://dot.net/v1/dotnet-install.sh \
&& D_V="$(curl -sSL https://dotnet.microsoft.com/en-us/download/dotnet/3.1 | grep -i '<h3 id="sdk-3.*">SDK 3.1.*</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

COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh
USER container
ENV USER=container HOME=/home/container

WORKDIR /home/container

COPY ./entrypoint.sh /entrypoint.sh
CMD ["/bin/bash", "/entrypoint.sh"]

0 comments on commit 4fce2a7

Please sign in to comment.