Skip to content

Commit

Permalink
updated dockerfile for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
CastillonMiguel committed Nov 11, 2024
1 parent 1e733bb commit 1f0a7d2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
with:
context: .
push: ${{ github.event_name == 'push' }}
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-base.outputs.tags }}
labels: ${{ steps.meta-base.outputs.labels }}
41 changes: 25 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
# 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
# We choose ubuntu 22.04 as our base docker image
FROM ghcr.io/fenics/dolfinx/dolfinx:v0.9.0

COPY . /repo
WORKDIR /repo

RUN python3 -m pip install vtk
# (from fenics: dolfinx/docker/Dockerfile.end-user)
RUN pip install --no-cache-dir jupyter jupyterlab

# pyvista dependencies from apt
RUN apt-get -qq update && \
apt-get -y install libgl1-mesa-dev xvfb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

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
# Install pyvista from PyPI. pyvisa depends on (py)vtk), but vtk wheels are not
# available on pypi for linux/arm64, so we use a custom build wheel.
# matplotlib improves plotting quality with better color maps and
# properly rendering colorbars.
# trame is the preferred backend for pyvista.
RUN dpkgArch="$(dpkg --print-architecture)"; \
pip install matplotlib; \
case "$dpkgArch" in amd64) \
pip install --no-cache-dir pyvista[trame]==${PYVISTA_VERSION} ;; \
esac; \
case "$dpkgArch" in arm64) \
pip install --no-cache-dir https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.3.0-cp312/vtk-9.3.0.dev0-cp312-cp312-linux_aarch64.whl && \
pip install --no-cache-dir pyvista[trame]==${PYVISTA_VERSION} ;; \
esac; \
pip cache purge

RUN python3 -m pip install .

0 comments on commit 1f0a7d2

Please sign in to comment.