diff --git a/.gitea/workflows/action.yaml b/.gitea/workflows/action.yaml index 45bc6ba..39c2646 100644 --- a/.gitea/workflows/action.yaml +++ b/.gitea/workflows/action.yaml @@ -1,6 +1,5 @@ name: 'Build docker container' on: - release: workflow_dispatch: inputs: branch: @@ -13,8 +12,6 @@ on: - 9.0-alpine-21 - 8.0-alpine-22 - 8.0-alpine-21 - - jobs: build: runs-on: ubuntu-latest @@ -26,7 +23,40 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.branch }} - + - name: Set build variables + id: variables + run: | + case "${{ inputs.branch }}" in + 9.0-alpine-23) + echo "DOTNET_SDK_VERSION=9.0.315" >> $GITHUB_OUTPUT + echo "DOTNET_RUNTIME_VERSION=9.0.17" >> $GITHUB_OUTPUT + echo "ALPINE_VERSION=3.23" >> $GITHUB_OUTPUT + ;; + 9.0-alpine-22) + echo "DOTNET_SDK_VERSION=9.0.312" >> $GITHUB_OUTPUT + echo "DOTNET_RUNTIME_VERSION=9.0.16" >> $GITHUB_OUTPUT + echo "ALPINE_VERSION=3.22" >> $GITHUB_OUTPUT + ;; + 9.0-alpine-21) + echo "DOTNET_SDK_VERSION=9.0.308" >> $GITHUB_OUTPUT + echo "DOTNET_RUNTIME_VERSION=9.0.15" >> $GITHUB_OUTPUT + echo "ALPINE_VERSION=3.21" >> $GITHUB_OUTPUT + ;; + 8.0-alpine-22) + echo "DOTNET_SDK_VERSION=8.0.416" >> $GITHUB_OUTPUT + echo "DOTNET_RUNTIME_VERSION=8.0.17" >> $GITHUB_OUTPUT + echo "ALPINE_VERSION=3.22" >> $GITHUB_OUTPUT + ;; + 8.0-alpine-21) + echo "DOTNET_SDK_VERSION=8.0.410" >> $GITHUB_OUTPUT + echo "DOTNET_RUNTIME_VERSION=8.0.16" >> $GITHUB_OUTPUT + echo "ALPINE_VERSION=3.21" >> $GITHUB_OUTPUT + ;; + *) + echo "Unsupported branch" + exit 1 + ;; + esac - name: Install Docker run: | echo "Checking docker installation" @@ -49,7 +79,7 @@ jobs: uses: docker/metadata-action@v5 with: labels: | - org.opencontainers.image.documentation=https://git.claeyscloud.com/david/epg-info-docker/src/branch/main/README.md + org.opencontainers.image.documentation=https://git.claeyscloud.com/david/net-base/README.md images: | git.claeyscloud.com/david/net-base tags: | @@ -65,7 +95,11 @@ jobs: - name: Build and push uses: https://github.com/docker/build-push-action@v5 with: - build-args: CERT_PASSWORD=${{ steps.password.outputs.secret }} + build-args: | + CERT_PASSWORD=${{ steps.password.outputs.secret }} + DOTNET_SDK_VERSION=${{ steps.variables.outputs.DOTNET_SDK_VERSION }} + DOTNET_RUNTIME_VERSION=${{ steps.variables.outputs.DOTNET_RUNTIME_VERSION }} + ALPINE_VERSION=${{ steps.variables.outputs.ALPINE_VERSION }} context: . push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/README.md b/README.md index c6526ce..67726d2 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,17 @@ Depending on your use-case you event might consider to use docker networking in The included certificate is generated through the _dotnet dev-certs_ command. This is a very convenient and suitable way to generate development certificates through the dotnet SDK. The password used to generate the certificate is randomly generated through the `openssl rand -base64 12` at build time. -The build agent used for the build is hosted on my own infrastructure but I don't have any access to it (neither do I intend to do so).
-However if you feel uncomfortable with this fact, feel free to build the image yourself. +If you inspect the image layers you'll able to easily see it. +I think this is fine for development purposes and just want to get things up and running, although this is not recommended for production use at all. +You can generate your own password and certificates in the following way : + +```sh +# generate a random secure password +openssl rand -base64 12 +# use the .net cli to generate your own certificates with your chosen password +dotnet dev-certs https --export-path /config/aspnetapp.pem --password "YOUR PASSWORD" --format PEM +``` +After this you only need to map your own certificates with the **ASPNETCORE_Kestrel__Certificates__** variables. ### Versioning