Skip to content

Commit 8d2f986

Browse files
committed
feat: add GitHub Actions workflows for building and publishing Docker images for base and fenics environments
1 parent b128c44 commit 8d2f986

4 files changed

Lines changed: 59 additions & 8 deletions

File tree

.github/workflows/docker-publish-tags.yml renamed to .github/workflows/docker-publish-tags-base.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Build and push Docker image
3232
uses: docker/build-push-action@v2
3333
with:
34-
context: .
34+
context: ./base
3535
push: true
36-
tags: ghcr.io/${{ github.actor }}/docker-4-teaching:${{ github.ref_name }}
36+
tags: ghcr.io/${{ github.actor }}/docker-4-teaching:latest
3737
platforms: linux/arm64,linux/amd64
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build and Publish Docker image
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
7+
jobs:
8+
push_to_registry:
9+
name: Push Docker image to GitHub Packages
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- name: Check out the repo
16+
uses: actions/checkout@v2
17+
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v2
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
24+
- name: Log in to GitHub Docker Registry
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ghcr.io
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GHCR_PAT }}
30+
31+
- name: Build and push Docker image
32+
uses: docker/build-push-action@v2
33+
with:
34+
context: ./fenics
35+
push: true
36+
tags: ghcr.io/${{ github.actor }}/docker-4-teaching-fenics:latest
37+
platforms: linux/arm64,linux/amd64

base/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM jupyter/base-notebook:latest
2+
3+
LABEL org.opencontainers.image.source=https://github.com/IMTEK-Simulation/Docker4Teching
4+
5+
USER root
6+
7+
RUN pip install --no-cache-dir \
8+
numpy \
9+
pandas \
10+
matplotlib \
11+
scikit-learn \
12+
jupyterlab
13+
14+
USER $NB_UID
15+
WORKDIR /home/jovyan/work
16+
17+
EXPOSE 8888
18+
CMD ["start-notebook.sh", "--NotebookApp.token=''"]

Dockerfile renamed to fenics/Dockerfile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ LABEL org.opencontainers.image.source=https://github.com/IMTEK-Simulation/Docker
44

55
USER root
66

7-
# Install mamba for faster package resolution
87
RUN conda install -c conda-forge mamba --yes
9-
10-
# Use mamba instead of conda for better memory usage
118
RUN mamba install -c conda-forge --yes \
129
numpy \
1310
pandas \
@@ -23,10 +20,9 @@ RUN mamba install -c conda-forge --yes \
2320
pip \
2421
&& conda clean -afy
2522

26-
WORKDIR /home/jovyan/work
27-
23+
2824
USER $NB_UID
25+
WORKDIR /home/jovyan/work
2926

3027
EXPOSE 8888
31-
3228
CMD ["start-notebook.sh", "--NotebookApp.token=''"]

0 commit comments

Comments
 (0)