-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
86 lines (69 loc) · 2.95 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
FROM ubuntu:18.04
MAINTAINER Christopher Dembia
# Build this docker container with a command like the following:
#
# docker build --tag <username>/mocopaper:<tag> .
#
# When building the Docker container on Windows or Mac, make sure Docker has
# access to at least 8 GB of RAM.
# https://stackoverflow.com/questions/44533319/how-to-assign-more-memory-to-docker-container
# Set DEBIAN_FRONTEND to avoid interactive timezone prompt when installing
# packages.
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
build-essential libtool autoconf \
cmake \
gfortran \
wget \
pkg-config \
libopenblas-dev \
liblapack-dev \
swig \
python3 python3-dev python3-numpy python3-setuptools
RUN git clone https://github.com/opensim-org/opensim-moco.git /opensim-moco \
&& cd /opensim-moco \
&& git checkout 0.4.0
COPY ./opensim-moco-eigen-url.patch eigen-url.patch
RUN cd /opensim-moco \
&& patch -p1 < ../eigen-url.patch \
&& git submodule update --init \
&& mkdir ../moco_dependencies_build \
&& cd ../moco_dependencies_build \
&& cmake ../opensim-moco/dependencies -DOPENSIM_PYTHON_WRAPPING=on \
&& make --jobs $(nproc) ipopt \
&& make --jobs $(nproc) \
&& echo "/moco_dependencies_install/adol-c/lib64" >> /etc/ld.so.conf.d/moco.conf \
&& echo "/moco_dependencies_install/ipopt/lib" >> /etc/ld.so.conf.d/moco.conf \
&& ldconfig \
&& rm -r /moco_dependencies_build
RUN cd / \
&& mkdir build \
&& cd build \
&& cmake ../opensim-moco \
-DMOCO_PYTHON_BINDINGS=on \
-DBUILD_TESTING=off \
-DBUILD_EXAMPLES=off \
&& make --jobs $(nproc) install \
&& echo "/opensim-moco-install/sdk/lib" >> /etc/ld.so.conf.d/moco.conf \
&& echo "/opensim-moco-install/sdk/Simbody/lib" >> /etc/ld.so.conf.d/moco.conf \
&& ldconfig \
&& cd /opensim-moco-install/sdk/Python && python3 setup.py install \
&& rm -r /build
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula \
select true | debconf-set-selections
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-pip python3-scipy python3-opencv \
ttf-mscorefonts-installer \
texlive-full rubber
# We need matplotlib 3.1.
# pillow allows saving images to TIFF.
RUN pip3 install matplotlib pillow
# Mount a volume to the Docker container's /output folder to save outputs
# to the local machine.
RUN echo "Creating the output directory." && mkdir /output
RUN git clone https://github.com/stanfordnmbl/mocopaper /mocopaper
# Matplotlib's default backend requires a DISPLAY / Xserver.
# RUN echo 'backend : Agg' >> /mocopaper/matplotlibrc && \
# echo 'font.sans-serif : Arial, Helvetica, sans-serif' >> /mocopaper/matplotlibrc
WORKDIR /mocopaper
ENTRYPOINT ["/bin/bash", "mocopaper.sh"]