-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
233 lines (231 loc) · 8.11 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Generated by Neurodocker and Reproenv.
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND="noninteractive"
RUN chmod 777 /tmp
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
build-essential \
ca-certificates \
curl \
git \
libglib2.0-0 \
libglu1-mesa \
libopengl0 \
libxi6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /opt/blender \
&& curl -fL https://download.blender.org/release/Blender2.79/blender-2.79b-linux-glibc219-x86_64.tar.bz2 | tar -xj -C /opt/blender --strip-components 1
ENV PATH="/opt/blender:$PATH"
RUN blender --version
RUN mkdir -p /opt/meshlab \
&& curl -fL https://github.com/cnr-isti-vclab/meshlab/releases/download/MeshLab-2022.02/MeshLab2022.02d-linux.tar.gz | tar -xz -C /opt/meshlab
ENV PATH="/opt/meshlab/usr/bin:$PATH"
RUN meshlab --version
ENV SKLEARN_NO_OPENMP="1"
COPY [".", \
"/headcase-pipeline"]
ENV CONDA_DIR="/opt/miniconda-py39_24.1.2-0" \
PATH="/opt/miniconda-py39_24.1.2-0/bin:$PATH"
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bzip2 \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/* \
# Install dependencies.
&& export PATH="/opt/miniconda-py39_24.1.2-0/bin:$PATH" \
&& echo "Downloading Miniconda installer ..." \
&& conda_installer="/tmp/miniconda.sh" \
&& curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-py39_24.1.2-0-Linux-x86_64.sh \
&& bash "$conda_installer" -b -p /opt/miniconda-py39_24.1.2-0 \
&& rm -f "$conda_installer" \
# Prefer packages in conda-forge
&& conda config --system --prepend channels conda-forge \
# Packages in lower-priority channels not considered if a package with the same
# name exists in a higher priority channel. Can dramatically speed up installations.
# Conda recommends this as a default
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html
&& conda config --set channel_priority strict \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
# Enable `conda activate`
&& conda init bash \
&& conda install -y --name base \
"python=3.9" \
"gxx_linux-64" \
&& bash -c "source activate base \
&& python -m pip install --no-cache-dir \
"-r" \
"/headcase-pipeline/requirements.txt"" \
# Clean up
&& sync && conda clean --all --yes && sync \
&& rm -rf ~/.cache/pip/*
RUN useradd -m -s /bin/bash -G users headcase
ENV HOME="/home/headcase"
RUN mkdir /home/headcase/.config
RUN python -c 'import cortex; print(cortex.__version__)'
RUN python -c 'import pymeshlab'
WORKDIR /headcase-pipeline
ENTRYPOINT ["python", "/headcase-pipeline/make_headcase.py"]
# Save specification to JSON.
RUN printf '{ \
"pkg_manager": "apt", \
"existing_users": [ \
"root" \
], \
"instructions": [ \
{ \
"name": "from_", \
"kwds": { \
"base_image": "ubuntu:20.04" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"DEBIAN_FRONTEND": "noninteractive" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "chmod 777 /tmp" \
} \
}, \
{ \
"name": "install", \
"kwds": { \
"pkgs": [ \
"git", \
"libopengl0", \
"build-essential", \
"curl", \
"ca-certificates", \
"libxi6", \
"libglu1-mesa", \
"libglib2.0-0", \
"libxrender1" \
], \
"opts": null \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq \\\\\\n && apt-get install -y -q --no-install-recommends \\\\\\n build-essential \\\\\\n ca-certificates \\\\\\n curl \\\\\\n git \\\\\\n libglib2.0-0 \\\\\\n libglu1-mesa \\\\\\n libopengl0 \\\\\\n libxi6 \\\\\\n libxrender1 \\\\\\n && rm -rf /var/lib/apt/lists/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir -p /opt/blender\\n\\tcurl -fL https://download.blender.org/release/Blender2.79/blender-2.79b-linux-glibc219-x86_64.tar.bz2 | tar -xj -C /opt/blender --strip-components 1" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"PATH": "/opt/blender:$PATH" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "blender --version" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir -p /opt/meshlab\\n\\tcurl -fL https://github.com/cnr-isti-vclab/meshlab/releases/download/MeshLab-2022.02/MeshLab2022.02d-linux.tar.gz | tar -xz -C /opt/meshlab" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"PATH": "/opt/meshlab/usr/bin:$PATH" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "meshlab --version" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"SKLEARN_NO_OPENMP": "1" \
} \
}, \
{ \
"name": "copy", \
"kwds": { \
"source": [ \
".", \
"/headcase-pipeline" \
], \
"destination": "/headcase-pipeline" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"CONDA_DIR": "/opt/miniconda-py39_24.1.2-0", \
"PATH": "/opt/miniconda-py39_24.1.2-0/bin:$PATH" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-py39_24.1.2-0/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-py39_24.1.2-0-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-py39_24.1.2-0\\nrm -f \\"$conda_installer\\"\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.9\\" \\\\\\n \\"gxx_linux-64\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"-r\\" \\\\\\n \\"/headcase-pipeline/requirements.txt\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "useradd -m -s /bin/bash -G users headcase" \
} \
}, \
{ \
"name": "env", \
"kwds": { \
"HOME": "/home/headcase" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "mkdir /home/headcase/.config" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "python -c '"'"'import cortex; print\(cortex.__version__\)'"'"'" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "python -c '"'"'import pymeshlab'"'"'" \
} \
}, \
{ \
"name": "workdir", \
"kwds": { \
"path": "/headcase-pipeline" \
} \
}, \
{ \
"name": "entrypoint", \
"kwds": { \
"args": [ \
"python", \
"/headcase-pipeline/make_headcase.py" \
] \
} \
} \
] \
}' > /.reproenv.json
# End saving to specification to JSON.