-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile_fixed_versions
99 lines (81 loc) · 3.37 KB
/
Dockerfile_fixed_versions
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
# Created by: George Corrêa de Araújo ([email protected])
FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-devel
# used to make generated files belong to actual user
ARG GROUPID=901
ARG GROUPNAME=deeplearning
ARG USERID=901
ARG USERNAME=dl
# Environment variables
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="pip --no-cache-dir install --upgrade" && \
DOWNLOAD_FILE="curl -LO" && \
# ==================================================================
# Create a system group with name deeplearning and id 901 to avoid
# conflict with existing uids on the host system
# Create a system user with id 901 that belongs to group deeplearning
# When building the image, these values will be replaced by actual
# user info
# ------------------------------------------------------------------
groupadd -r $GROUPNAME -g $GROUPID && \
useradd -u $USERID -m -g $GROUPNAME $USERNAME && \
# ==================================================================
# install libraries via apt-get
# ------------------------------------------------------------------
rm -rf /var/lib/apt/lists/* && \
# temporary solution for bug
# see https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu1804-x86-64/212904/3
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/3bf863cc.pub && \
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
bc=1.07.1-2 \
curl \
git \
libffi-dev=3.2.1-8 \
rsync \
wget && \
# ==================================================================
# install python libraries via pip
# ------------------------------------------------------------------
$PIP_INSTALL \
pip==22.0.4 \
setuptools==62.2.0 \
wheel==0.37.1 && \
$PIP_INSTALL \
comet-ml==3.31.0 \
datasets==2.3.2 \
ipdb==0.13.9 \
ipython==8.3.0 \
kornia==0.6.4 \
matplotlib==3.5.2 \
numpy==1.22.3 \
Pillow==9.1.0 \
piq==0.7.0 \
prettytable==3.3.0 \
# specify protobuf to avoid bug with tensorboard
# https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
protobuf==3.20 \
pytorch-lightning==1.6.3 \
tensorboard==2.9.0 \
torch_optimizer==0.3.0 \
tqdm==4.64.0 && \
# ==================================================================
# install python libraries via git
# ------------------------------------------------------------------
$PIP_INSTALL git+https://github.com/jonbarron/robust_loss_pytorch@9831f1db8 && \
# ==================================================================
# send telegram message
# ------------------------------------------------------------------
$PIP_INSTALL \
telegram-send==0.33.1 && \
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
ldconfig && \
apt-get clean && \
apt-get autoremove && \
/opt/conda/bin/conda clean -ya && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
USER $USERNAME
# Expose TensorBoard ports
EXPOSE 6006 7000