Skip to content

Commit

Permalink
feat: Add Dockerfile.dotnet6
Browse files Browse the repository at this point in the history
  • Loading branch information
woky committed Jun 15, 2022
1 parent 93048ee commit 01b4b19
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: push
env:
test-results-folder: _test-results
test-runtime-deps-image-name: ubuntu/dotnet-runtime-deps:test
test-runtime-image-name: ubuntu/dotnet-runtime:test
test-oci-image-name: ubuntu_dotnet-runtime-deps_test
log-file: output.log

Expand Down Expand Up @@ -35,11 +36,22 @@ jobs:
dockerfile: Dockerfile.runtime
ignore: DL3008,SC2046,DL3015

- name: Lint the .NET runtime container image recipe
uses: hadolint/hadolint-action@v2.0.0
with:
dockerfile: Dockerfile.dotnet6
ignore: DL3008,SC2046,DL3015,DL3003,DL3006

- name: Build the .NET runtime deps container image
run: |
exec &> >(tee ${{ github.workspace }}/${{ env.test-results-folder }}/${{ env.log-file }})
docker build -t ${{ env.test-runtime-deps-image-name }} -f Dockerfile.runtime .
- name: Build the .NET runtime container image
run: |
exec &> >(tee ${{ github.workspace }}/${{ env.test-results-folder }}/${{ env.log-file }})
docker build -t ${{ env.test-runtime-image-name }} -f Dockerfile.dotnet6 --build-arg RUNTIME_DEPS_IMAGE=${{ env.test-runtime-deps-image-name }} .
- name: Collect ${{ env.test-runtime-deps-image-name }} as an OCI artifact
run: |
exec &> >(tee -a ${{ github.workspace }}/${{ env.test-results-folder }}/${{ env.log-file }})
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile.dotnet6
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG RUNTIME_DEPS_IMAGE
ARG DOTNET_VERSION="6.0.5"
ARG DOTNET_SHA512="c228f0ba0ecc4ccda708e97529b248dd6d70f7f747ead6453623be77e8e1529b54db52f5df1b5e00b5b7f92b73389560832f80607fc07e50879d55ce905afcf7"

FROM ubuntu:22.04 as builder
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl ca-certificates
ARG DOTNET_VERSION DOTNET_SHA512
SHELL ["/bin/bash", "-oeux", "pipefail", "-c"]
RUN curl -fSL -o /dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-x64.tar.gz \
&& echo "$DOTNET_SHA512 /dotnet.tar.gz" | sha512sum -c - \
&& mkdir /rootfs-dotnet \
&& cd /rootfs-dotnet \
&& mkdir -p usr/share/dotnet usr/bin \
&& tar -oxzf /dotnet.tar.gz -C usr/share/dotnet \
&& rm /dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet usr/bin/dotnet

FROM $RUNTIME_DEPS_IMAGE
ARG DOTNET_VERSION
ENV DOTNET_VERSION=$DOTNET_VERSION
COPY --from=builder /rootfs-dotnet/ /

0 comments on commit 01b4b19

Please sign in to comment.