This repository has been archived by the owner on May 20, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
110 lines (102 loc) · 3.36 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
FROM ubuntu:16.04
MAINTAINER Sviatoslav Sydorenko <wk+freecad-cli-py3.7-docker@sydorenko.org.ua>
ENV PYTHON_VERSION 3.7.3
ENV PYTHON_MINOR_VERSION 3.7
ENV PYTHON_SUFFIX_VERSION .cpython-37m
ENV PYTHON_BIN_VERSION python3.7m
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 18.0
ENV FREECAD_VERSION master
ENV FREECAD_REPO git://github.com/FreeCAD/FreeCAD.git
RUN \
pack_build="git \
python$PYTHON_MINOR_VERSION \
python$PYTHON_MINOR_VERSION-dev \
wget \
build-essential \
cmake \
libtool \
libxerces-c-dev \
libboost-dev \
libboost-filesystem-dev \
libboost-regex-dev \
libboost-program-options-dev \
libboost-signals-dev \
libboost-thread-dev \
libboost-python-dev \
libqt4-dev \
libqt4-opengl-dev \
qt4-dev-tools \
liboce-modeling-dev \
liboce-visualization-dev \
liboce-foundation-dev \
liboce-ocaf-lite-dev \
liboce-ocaf-dev \
oce-draw \
libeigen3-dev \
libqtwebkit-dev \
libode-dev \
libzipios++-dev \
libfreetype6 \
libfreetype6-dev \
netgen-headers \
libmedc-dev \
libvtk6-dev \
libproj-dev \
gmsh " \
&& apt update \
&& apt install -y --no-install-recommends software-properties-common \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt update \
&& apt install -y --no-install-recommends $pack_build
RUN set -ex; \
\
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
\
python$PYTHON_MINOR_VERSION get-pip.py \
--disable-pip-version-check \
--no-cache-dir \
"pip==$PYTHON_PIP_VERSION" \
; \
pip --version; \
\
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' +; \
rm -f get-pip.py
ENV PYTHONPATH "/usr/local/lib:$PYTHONPATH"
RUN \
# get FreeCAD Git
cd \
&& git clone --branch "$FREECAD_VERSION" "$FREECAD_REPO" \
&& mkdir freecad-build \
&& cd freecad-build \
# Build
&& cmake \
-DBUILD_GUI=OFF \
-DBUILD_QT5=OFF \
-DPYTHON_EXECUTABLE=/usr/bin/$PYTHON_BIN_VERSION \
-DPYTHON_INCLUDE_DIR=/usr/include/$PYTHON_BIN_VERSION \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/lib${PYTHON_BIN_VERSION}.so \
-DPYTHON_BASENAME=$PYTHON_SUFFIX_VERSION \
-DPYTHON_SUFFIX=$PYTHON_SUFFIX_VERSION \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_FEM_NETGEN=ON ../FreeCAD \
\
&& make -j$(nproc) \
&& make install \
&& cd \
\
# Clean
&& rm FreeCAD/ freecad-build/ -fR \
&& ln -s /usr/local/bin/FreeCAD /usr/bin/freecad-git
# Clean
RUN apt-get clean \
&& rm /var/lib/apt/lists/* \
/usr/share/doc/* \
/usr/share/locale/* \
/usr/share/man/* \
/usr/share/info/* -fR