-
Notifications
You must be signed in to change notification settings - Fork 1
/
container.def
61 lines (49 loc) · 1.49 KB
/
container.def
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
BootStrap: docker
From: python:3.8.11-buster
%files
requirements.txt /usr/project/python/requirements.txt
dask_config.yml /etc/dask/dask_config.yml
%post
# Apt packages - Note: If we install Python here (as opposed to building
# from a Python container) we end up with one of the old versions in the
# apt repositories.
apt-get update
apt-get install -y \
wget \
git \
zip \
unzip \
libgl1-mesa-dev \
libgl1-mesa-glx \
mesa-utils \
libglew-dev \
libosmesa6-dev \
patchelf \
ffmpeg \
default-jdk
apt-get clean
rm -rf /var/lib/apt/lists/*
# Microsoft fonts (particularly Times)
# https://stackoverflow.com/questions/60934639/install-fonts-in-linux-container-for-asp-net-core#62888227
sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list
apt-get update
apt-get install -y ttf-mscorefonts-installer fontconfig
fc-cache -f -v
# Project
PROJECT_ROOT=/usr/project
mkdir -p $PROJECT_ROOT
# Python
pip3 install -r $PROJECT_ROOT/python/requirements.txt
%environment
export PROJECT_ROOT=/usr/project
# Set X11 display for GUI output
export DISPLAY=":1"
# Set numpy to be single-threaded
export OPENBLAS_NUM_THREADS=1
# Detect package
export PYTHONPATH="."
# Trim memory aggressively
# https://github.com/dask/distributed/issues/5279
export MALLOC_TRIM_THRESHOLD_=0
%runscript
echo "No runscript specified"