Skip to content

Commit

Permalink
docker recipe and build-image
Browse files Browse the repository at this point in the history
  • Loading branch information
d2f4d131d9eac6cc27e3d6245ab1476b committed Mar 25, 2024
1 parent 7c18dea commit 1b1844d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build numerix-fenicsx-stable container
run-name: ${{ github.actor }} is building numerix containers

on:
push:
branches:
- andres-rev-patch

jobs:
run-docker-container:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build Docker image for multiple platforms
run: |
docker buildx build --platform linux/amd64 -t numerix:stable docker/fenicsx-stable.dockerfile
- name: Run Docker container
run: docker run --rm numerix:stable
4 changes: 4 additions & 0 deletions .github/workflows/pull-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
# Step 0: Checkout
- name: Checkout repository
uses: actions/checkout@v4

# Step 1: Pull the Docker container from Docker Hub
- name: Pull Docker Container
run: docker pull kumiori3/numerix:stable
Expand Down
46 changes: 46 additions & 0 deletions docker/fenicsx-stable.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM dolfinx/dolfinx:stable

ARG PYVISTA_VERSION=0.43.2
ARG PYTHON_VERSION=3.10


# Dependencies for pyvista and related packages

RUN pip3 install --upgrade --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/*

# Upgrade setuptools and pip
RUN python3 -m pip install -U setuptools pip pkgconfig

RUN echo ${TARGETPLATFORM}

RUN echo "PLATFORM" ${TARGETPLATFORM}

RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then python3 -m pip install "https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.2.6-cp310/vtk-9.2.6.dev0-cp310-cp310-linux_aarch64.whl"; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then python3 -m pip install vtk; fi

RUN dpkgArch="$(dpkg --print-architecture)"; \
case "$dpkgArch" in arm64) \
python3 -m pip install "https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.2.6-cp310/vtk-9.2.6.dev0-cp310-cp310-linux_aarch64.whl" ;; \
esac;
RUN python3 -m pip install pyvista


RUN pip3 install matplotlib ipython pandas
RUN pip3 install black sympy flake8 autoflake8
RUN pip3 install tqdm colorcet

RUN apt-get update --assume-yes

# Install libosmesa
RUN apt-get install libosmesa6-dev --assume-yes





0 comments on commit 1b1844d

Please sign in to comment.