Commit 896d3a9a authored by Lloyd Connellan's avatar Lloyd Connellan
Browse files

copy of dune-python docker

parents
FROM registry.dune-project.org/staging/dune-python:2.6
MAINTAINER "Martin Nolte"
USER root
RUN apt-get update && apt-get dist-upgrade --yes --no-install-recommends
RUN apt-get install --yes --no-install-recommends \
libeigen3-dev libsuitesparse-dev \
python3-ufl
ADD install-example.sh /root/
RUN /root/install-example.sh
COPY example.ipynb /dune/
RUN chown dune:dune /dune/example.ipynb
USER dune
# RUN cp -r /usr/local/share/doc/dune-fempy/jupyter /dune/dune-fempy
# COPY --chown=dune:dune twophaseflow.ipynb limit.py utility.hh /dune/
# dockerproject
A template for setting up docker images for dune-python.
The idea is to copy all files into your own git repository and adapt
accordingly.
__Note__: that the Docker container for `example' is not uploaded.
# How to Build/Update/Run the Docker Image
To update the Docker image on `registry.dune-project.org`,
please follow these steps:
__Note__: you will have to change the
`andreas.dedner/example` to your own local space and desired container
name.
1. Pull the Docker base image:
```
docker pull registry.dune-project.org/staging/dune-python:2.6
```
Please do not omit this step just because you already have the image. Otherwise
an outdated version of the base image might be used.
1. Actually build the Docker image:
```
docker build . --no-cache -t registry.dune-project.org/andreas.dedner/example:latest
```
Please do not omit `--no-cache` to ensure every step of the build is actually
executed.
*Note*: This will set up the Debian base system of the Docker image, which takes
quite some time.
1. Verify your build by testing the Docker image locally:
```
docker run --rm -v dune:/dune -p 127.0.0.1:8888:8888 registry.dune-project.org/andreas.dedner/example:latest
```
Use your favorite web browser, visit http://127.0.0.1:8888, enter the password
`dune`, and run the demo notebooks (depending on the jupyter version you
might be given tokenized http address to use instead).
*Note*: If you already have a volume `dune`, you will not receive the updated demo notebooks. It might be better to start with a clean volume.
1. Log into the Docker registry:
```
docker login registry.dune-project.org
```
1. Push the Docker image:
```
docker push registry.dune-project.org/andreas.dedner/example:latest
```
This step actually updates the Docker image on the server.
**Warning:** Updating the official Docker image affects all users of the
image once they pull it.
Make sure you don't push a buggy combination of the DUNE modules.
1. Log out of the Docker registry:
```
docker logout registry.dune-project.org
```
That's it.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Preamble\n",
"========"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import math\n",
"\n",
"from ufl import *\n",
"from dune.ufl import Space, NamedConstant\n",
"\n",
"import dune.fem as fem\n",
"import dune.create as create\n",
"from dune.generator import algorithm\n",
"from dune.common import FieldVector\n",
"from dune.grid import cartesianDomain, Marker, gridFunction\n",
"from dune.fem.function import levelFunction, integrate\n",
"from dune.plotting import plotPointData as plot\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
# coding: utf-8
# Preamble
# ========
# In[ ]:
import math
from ufl import *
from dune.ufl import Space, NamedConstant
import dune.fem as fem
import dune.create as create
from dune.generator import algorithm
from dune.common import FieldVector
from dune.grid import cartesianDomain, Marker, gridFunction
from dune.fem.function import levelFunction, integrate
from dune.plotting import plotPointData as plot
#!/bin/bash
set -e
mkdir /tmp/dune
cd /tmp/dune
export CMAKE_FLAGS=" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=TRUE \
-DDUNE_PYTHON_INSTALL_LOCATION=system \
"
wget -qO - https://gitlab.dune-project.org/dune-fem/dune-fem/repository/archive.tar.gz?ref=releases/2.6 | tar xz
wget -qO - https://gitlab.dune-project.org/dune-fem/dune-fempy/repository/archive.tar.gz?ref=master | tar xz
dunecontrol all
dunecontrol make install
cd /
rm -rf /tmp/dune
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment