Skip to content

Commit

Permalink
Try add multiplatform
Browse files Browse the repository at this point in the history
  • Loading branch information
pocki committed Dec 27, 2024
1 parent 7788225 commit 0a3d43b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,67 +27,67 @@ jobs:
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ghcr.io
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push minimal-dotnet
id: docker_build_minimal
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6
with:
push: true
build-args: base_image=quay.io/jupyter/minimal-notebook
build-args: base_image=quay.io/jupyter/minimal-notebook:ubuntu-24.04
tags: ghcr.io/pocki/jupyter-dotnet:minimal-dotnet8-latest, ghcr.io/pocki/jupyter-dotnet:minimal-dotnet8-${{ steps.prep.outputs.datetag }}, ghcr.io/pocki/jupyter-dotnet:minimal-dotnet8-${{ github.ref_name }}
labels: |
type: minimal
org.opencontainers.image.title=Jupyter .NET (minimal)
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64
platforms: linux/amd64,linux/arm64

- name: Image digest minimal-dotnet
run: echo ${{ steps.docker_build_minimal.outputs.digest }}

- name: Build and push scipy-dotnet
id: docker_build_scipy
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6
with:
push: true
build-args: base_image=quay.io/jupyter/scipy-notebook
build-args: base_image=quay.io/jupyter/scipy-notebook:ubuntu-24.04
tags: ghcr.io/pocki/jupyter-dotnet:scipy-dotnet8-latest, ghcr.io/pocki/jupyter-dotnet:scipy-dotnet8-${{ steps.prep.outputs.datetag }}, ghcr.io/pocki/jupyter-dotnet:scipy-dotnet8-${{ github.ref_name }}
labels: |
type: scipy
org.opencontainers.image.title=Jupyter .NET (SciPy)
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64
platforms: linux/amd64,linux/arm64

- name: Image digest scipy-dotnet
run: echo ${{ steps.docker_build_scipy.outputs.digest }}

- name: Build and push r-dotnet
id: docker_build_r
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6
with:
push: true
build-args: base_image=quay.io/jupyter/r-notebook
build-args: base_image=quay.io/jupyter/r-notebook:ubuntu-24.04
tags: ghcr.io/pocki/jupyter-dotnet:r-dotnet8-latest, ghcr.io/pocki/jupyter-dotnet:r-dotnet8-${{ steps.prep.outputs.datetag }}, ghcr.io/pocki/jupyter-dotnet:r-dotnet8-${{ github.ref_name }}
labels: |
type: r
org.opencontainers.image.title=Jupyter .NET (R)
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64
platforms: linux/amd64,linux/arm64

- name: Image digest r-dotnet
run: echo ${{ steps.docker_build_r.outputs.digest }}
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
ARG base_image=quay.io/jupyter/minimal-notebook
FROM ${base_image} as base

ARG TARGETPLATFORM
ENV ARCHITECTURE $ARCHITECTURE
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
Expand Down Expand Up @@ -41,11 +43,19 @@ RUN apt-get update \
libgdiplus \
&& rm -rf /var/lib/apt/lists/*

ENV DOTNET_SDK_VERSION 8.0.403
ENV DOTNET_SDK_VERSION 8.0.404
ENV DOTNET_SDK_CHECKSUM ''
# Install .NET Core SDK
RUN dotnet_sdk_version=8.0.403 \
&& curl -SL --output dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-x64.tar.gz \
&& dotnet_sha512='7aa03678228b174f51c4535f18348cdf7a5d35e243b1f8cb28a4a30e402e47567d06df63c8f6da4bdc3c7e898f54f4acc08d9952bfa49d3f220d0353253ac3e9' \
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
ARCHITECTURE=x64; \
DOTNET_SDK_CHECKSUM='2f166f7f3bd508154d72d1783ffac6e0e3c92023ccc2c6de49d22b411fc8b9e6dd03e7576acc1bb5870a6951181129ba77f3bf94bb45fe9c70105b1b896b9bb9'; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
ARCHITECTURE=arm64; \
DOTNET_SDK_CHECKSUM='d147ca2e6aad8bc751b522ae91399e0e3867c42d17f892e23c8dd086ab6ccb0c13319d9b89c024b5a61ffb298e95bcfc82d9256074ddace882145c9d5a4be071'; \
fi \
&& dotnet_sdk_version=${DOTNET_SDK_VERSION} \
&& curl -SL --output dotnet.tar.gz https://builds.dotnet.microsoft.com/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-${ARCHITECTURE}.tar.gz \
&& dotnet_sha512=${DOTNET_SDK_CHECKSUM} \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -ozxf dotnet.tar.gz -C /usr/share/dotnet \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Every image type is also available with the build date in the tag do use static/

On build there is always the latest available version of base image, .NET and dotnet interactive used.

# .NET 6/.NET 7
# .NET 6/.NET 7 (Out-of-support)

.NET 6 kernel in tag 20220210 and later
.NET 7 kernel in tag 20230315 and later
Expand Down

0 comments on commit 0a3d43b

Please sign in to comment.