-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile and github workflow for Docker image build and push
- Loading branch information
1 parent
19b26dd
commit 0bbc6eb
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for base-image | ||
id: meta-base | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: ${{ github.event_name == 'push' }} | ||
platforms: linux/amd64 | ||
tags: ${{ steps.meta-base.outputs.tags }} | ||
labels: ${{ steps.meta-base.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# We choose ubuntu 22.04 as our base docker image (linux/amd64) | ||
FROM ghcr.io/fenics/dolfinx/dolfinx:v0.9.0@sha256:61f17eb5de64721e8bbfc06b0e715bd8d0c3b6f8ec37d30f6985016c6ac68472 | ||
|
||
ENV PYVISTA_JUPYTER_BACKEND="html" | ||
|
||
# Requirements for pyvista | ||
RUN apt-get update && apt-get install -y libgl1 libglx-mesa0 | ||
RUN apt-get update && apt-get install -y libxrender1 | ||
RUN apt-get update && apt-get install -y xvfb | ||
RUN apt-get update && apt-get install -y nodejs | ||
|
||
COPY . /repo | ||
WORKDIR /repo | ||
|
||
RUN python3 -m pip install vtk | ||
|
||
RUN python3 -m pip install jupyter-book | ||
RUN python3 -m pip install jupyter | ||
RUN python3 -m pip install pyvista[all] | ||
RUN python3 -m pip install trame-vuetify | ||
RUN python3 -m pip install ipywidgets | ||
|
||
RUN python3 -m pip install . | ||
|