-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
84 lines (68 loc) · 2.7 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This Dockerfile creates an enviroment with the optional dependancies and the Paramak
# This dockerfile can be built in a few different ways.
# Docker build commands must be run from within the base repository directory
#
# There are build args availalbe for specifying the:
# - cq_version
# The version of CadQuery to use master or 2.1
# Default is master
# Options: [master, 2, 2.1]
#
# - paramak_version
# The version number applied to the paramak. The CI finds this version number
# from the release tag.
# Default is develop
# Options: version number with three numbers separated by . for example 0.7.1
#
# Example builds:
# Building using the defaults (cq_version 2.1)
# docker build -t paramak .
#
# Building to include cadquery master.
# Run command from within the base repository directory
# docker build -t paramak --build-arg cq_version=master .
#
# Once build the dockerimage can be run in a few different ways.
#
# Run with the following command for a terminal notebook interface
# docker run -it paramak /bin/bash
#
# Run with the following command for a jupyter notebook interface
# docker run -p 8888:8888 paramak
#
# Once built, the docker image can be tested with either of the following commands
# docker run --rm paramak pytest /tests
# docker run --rm paramak /bin/bash -c "bash run_tests.sh"
FROM continuumio/miniconda3:4.9.2 as dependencies
# By default this Dockerfile builds with the latest release of CadQuery 2
ARG cq_version=master
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 \
DEBIAN_FRONTEND=noninteractive
RUN apt-get --allow-releaseinfo-change update
RUN apt-get update -y && \
apt-get upgrade -y
RUN apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev curl imagemagick && \
apt-get clean
# Installing CadQuery and Gmsh
RUN echo installing CadQuery version $cq_version && \
conda install -c conda-forge -c python python=3.8 && \
conda install -c conda-forge -c cadquery cadquery="$cq_version" && \
conda install -c conda-forge moab && \
conda install -c conda-forge gmsh && \
conda install -c conda-forge python-gmsh && \
pip install jupyter-cadquery && \
conda clean -afy
RUN mkdir /home/paramak
EXPOSE 8888
WORKDIR /home/paramak
FROM dependencies as final
ARG paramak_version=develop
COPY run_tests.sh run_tests.sh
COPY src src/
COPY examples examples/
COPY tests tests/
COPY pyproject.toml pyproject.toml
COPY README.md README.md
COPY LICENSE.txt LICENSE.txt
RUN SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PARAMAK=${paramak_version} pip install .[tests,docs]
CMD ["jupyter", "lab", "--notebook-dir=/home/paramak/examples", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]