Skip to content

Commit

Permalink
Add workflow making wsl image
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Oct 16, 2024
1 parent 293c7dc commit 1d0f387
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/create-wsl-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build Docker Image and Export for WSL

on:
schedule:
- cron: '0 2 * * *' # Run every day
workflow_dispatch:

jobs:
build-and-export:
runs-on: ubuntu-latest

steps:
- name: Prepare Dockerfile
run: |
curl -o Dockerfile https://raw.githubusercontent.com/sagemath/sage-binder-env/master/Dockerfile
sed -i '/COPY notebooks/d' Dockerfile # remove the line from Dockerfile
- name: Extract version from Dockerfile
id: extract_version
run: |
VERSION=$(grep '^FROM ghcr.io/sagemath/sage-binder-env:' Dockerfile | sed 's/^FROM ghcr.io\/sagemath\/sage-binder-env://')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build and export Docker image
run: |
docker build -t sagemath-container .
export CONTAINER_ID=$(docker create sagemath-container)
docker export $CONTAINER_ID -o sagemath-$VERSION-wsl.tar
- name: Upload tar file as artifact
uses: actions/upload-artifact@v3
with:
name: sagemath-wsl-image
path: sagemath-${{ env.VERSION }}-wsl.tar
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dockerfile for binder
# Reference: https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html

FROM ghcr.io/sagemath/sage-binder-env:10.2
FROM ghcr.io/sagemath/sage-binder-env:10.4

USER root

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Extending the Dockerfile

The `Dockerfile` is based on the Docker image::

FROM ghcr.io/sagemath/sage-binder-env:10.2
FROM ghcr.io/sagemath/sage-binder-env:10.4

which contains the latest stable version of Sage.

Expand Down

0 comments on commit 1d0f387

Please sign in to comment.