-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
145 lines (112 loc) · 3.74 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
# BUILD IMAGE: docker build -t soft/teacher:v1 .
# START CONTAINER: docker run -v /raid/utku/:/workspace -t pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime
# Docker volume (~mount):
# You can also copy with ADD. This copies, not good ADD /raid/utku /workspace
# Docker cp to copy from local to docker running container.
# Not suggested: ENV DEBIAN_FRONTEND=noninteractive
# ARG PYTORCH_VERSION="1.9.0"
# ARG CUDA_VERSION="10.2"
# ARG CUDNN_VERSION="7"
# # FROM nvidia/cuda:11.3.1-base-ubuntu16.04
# # BASE IMAGE
# FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
# # FROM pytorch/pytorch:${PYTORCH_VERSION}-cuda${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel
# # Create workdir
# # This did not work: COPY . /workspace/
# # Force cuda do not know exactly why.
# ENV FORCE_CUDA="1"
# PYTHON DEPENDENCIES
# ENV PYTHON_VERSION=3.6
# ENV MMDETECTION_VERSION=2.16.0+fe46ffe
# ENV MMCV_VERSION=1.3.9
# ENV WANDB=0.10.31
# Apt installations. python3-opencv
#&& apt-get clean \
# && rm -rf /var/lib/apt/lists/*
# RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \
# gcc git tmux nano make
# WORKDIR /workspace
# RUN make install
# RUN apt-get update
# RUN apt-get install software-properties-common -y
# RUN add-apt-repository ppa:deadsnakes/ppa
# RUN apt-get update
# RUN apt-get install python3.6 -y
# RUN apt-get install python3.6-dev
# RUN apt-get install python3.6-pip
# Install python packages ==${MMDETECTION_VERSION}
# RUN pip3 install mmcv==${MMCV_VERSION} wandb==${WANDB}
# Install mmdetections
# RUN git clone https://github.com/open-mmlab/mmdetection.git /mmdetection
# WORKDIR /mmdetection
# RUN pip3 install -r requirements/build.txt
# RUN pip3 install --no-cache-dir -e .
# install requirments.
FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
ENV PROJECT=soft_teacher
ENV PYTORCH_VERSION=1.9.0
# ARG CUDNN_VERSION="7"
ENV CUDNN_VERSION=7.6.5.32-1+cuda10.2
ENV NCCL_VERSION=2.5.6-1+cuda10.2
# apt-cache policy libnccl2
# ENV DEBIAN_FRONTEND=noninteractive
ARG python=3.6
ENV PYTHON_VERSION=${python}
SHELL ["/bin/bash", "-cu"]
RUN apt-get update && apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
build-essential \
cmake \
g++-4.8 \
git \
curl \
docker.io \
vim \
wget \
ca-certificates \
libcudnn7=${CUDNN_VERSION} \
libnccl2=${NCCL_VERSION} \
libnccl-dev=${NCCL_VERSION} \
libjpeg-dev \
libpng-dev \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python3-tk \
librdmacm1 \
libibverbs1 \
ibverbs-providers \
libgtk2.0-dev \
unzip \
bzip2 \
htop \
gnuplot \
ffmpeg
# # Install latest CMake
# RUN apt-get remove -y --purge --auto-remove cmake
# RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
# RUN apt-get install -y software-properties-common
# RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
# RUN apt-get update
# RUN apt-get install -y cmake
# RUN apt-get install -y kitware-archive-keyring
# RUN rm /etc/apt/trusted.gpg.d/kitware.gpg
# RUN apt-get update
# # Instal Python and pip
# RUN if [[ "${PYTHON_VERSION}" == "3.6" ]]; then \
# apt-get install -y python${PYTHON_VERSION}-distutils; \
# fi
# RUN ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python
# RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
# python get-pip.py && \
# rm get-pip.py
# # Install PyTorch
# RUN pip install torch==${PYTORCH_VERSION}
# RUN pip install \
# cython \
# numpy \
# pillow \
# pillow-simd \
# opencv-python \
# opencv-contrib-python \
# opencv-python-headless \
# numba \
# tqdm