Skip to content

Commit 9dfdc0f

Browse files
committed
add dockerfile
1 parent a58993e commit 9dfdc0f

File tree

6 files changed

+192
-0
lines changed

6 files changed

+192
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# remap prefix from 'C-b' to 'C-w'
2+
unbind C-b
3+
set-option -g prefix C-x
4+
bind-key C-x send-prefix
5+
6+
bind C new-window -c "#{pane_current_path}"
7+
bind | split-window -h -c "#{pane_current_path}"
8+
bind - split-window -v -c "#{pane_current_path}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# ==================================================================
2+
# module list
3+
# ------------------------------------------------------------------
4+
# python 3.6 (apt)
5+
# pytorch latest (pip)
6+
# ==================================================================
7+
# FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu18.04
8+
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
9+
ENV LANG C.UTF-8
10+
11+
ENV APT_INSTALL="apt-get install -y --no-install-recommends" \
12+
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --default-timeout=100000" \
13+
GIT_CLONE="git clone --depth 1"
14+
15+
# added by user
16+
COPY ./sources.list.tuna.txt /etc/apt/
17+
RUN bash -xc " \
18+
echo 'change sources.list to tuna source' && \
19+
pushd /etc/apt && \
20+
mv sources.list sources.list.origin.txt && \
21+
mv sources.list.tuna.txt sources.list && \
22+
popd \
23+
"
24+
25+
RUN rm -rf /var/lib/apt/lists/* \
26+
/etc/apt/sources.list.d/cuda.list \
27+
/etc/apt/sources.list.d/nvidia-ml.list && \
28+
29+
apt-get update && \
30+
31+
# ==================================================================
32+
# tools
33+
# ------------------------------------------------------------------
34+
35+
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
36+
build-essential \
37+
apt-utils \
38+
ca-certificates \
39+
wget \
40+
git \
41+
vim \
42+
libssl-dev \
43+
curl \
44+
unzip \
45+
unrar \
46+
&& \
47+
48+
$GIT_CLONE https://github.com/Kitware/CMake ~/cmake && \
49+
cd ~/cmake && \
50+
./bootstrap && \
51+
make -j"$(nproc)" install && \
52+
53+
# ==================================================================
54+
# python
55+
# ------------------------------------------------------------------
56+
57+
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
58+
software-properties-common \
59+
&& \
60+
add-apt-repository ppa:deadsnakes/ppa && \
61+
apt-get update && \
62+
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
63+
python3.6 \
64+
python3.6-dev \
65+
python3-distutils-extra \
66+
&& \
67+
wget -O ~/get-pip.py \
68+
https://bootstrap.pypa.io/get-pip.py && \
69+
python3.6 ~/get-pip.py && \
70+
ln -s /usr/bin/python3.6 /usr/local/bin/python3 && \
71+
ln -s /usr/bin/python3.6 /usr/local/bin/python && \
72+
$PIP_INSTALL \
73+
setuptools \
74+
&& \
75+
$PIP_INSTALL \
76+
# numpy \
77+
# scipy \
78+
# pandas \
79+
cloudpickle \
80+
# scikit-image>=0.14.2 \
81+
# scikit-learn \
82+
# matplotlib \
83+
# Cython \
84+
tqdm \
85+
&& \
86+
87+
# ==================================================================
88+
# pytorch
89+
# ------------------------------------------------------------------
90+
91+
$PIP_INSTALL \
92+
future \
93+
# numpy \
94+
protobuf \
95+
enum34 \
96+
pyyaml \
97+
typing \
98+
&& \
99+
100+
# $PIP_INSTALL \
101+
# --pre torch torchvision -f \
102+
# https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html \
103+
# && \
104+
105+
# $PIP_INSTALL torch==1.5.1 torchvision==0.6.1 && \
106+
107+
# ==================================================================
108+
# config & cleanup
109+
# ------------------------------------------------------------------
110+
111+
ldconfig && \
112+
apt-get clean && \
113+
apt-get autoremove && \
114+
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
115+
116+
# ==================================================================
117+
# additional apt pacakges
118+
# ------------------------------------------------------------------
119+
120+
# personal tmux config file
121+
COPY ./.tmux.conf /root/
122+
RUN apt update && \
123+
$APT_INSTALL tmux && \
124+
# needed by opencv
125+
$APT_INSTALL libsm6 libxrender1 libxext6 && \
126+
$APT_INSTALL htop && \
127+
echo "tmux installed."
128+
129+
# TODO: add cloning of https://github.com/tmux-plugins/tmux-resurrect @ /root/Utils
130+
131+
# ==================================================================
132+
# video_analyst
133+
# ------------------------------------------------------------------
134+
COPY ./requirements.txt /root/
135+
RUN $PIP_INSTALL -r /root/requirements.txt && \
136+
echo "ended."
137+
138+
# TODO: only wget & install: https://github.com/MARMOTatZJU/video_analyst/blob/dev/requirements.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Typical command to build a docker image from dockerfile
2+
3+
```bash
4+
docker build -t video_analyst/siamfcpp:vot-eval -f ./Dockerfile ./
5+
docker run -itd --name vot-eval --network host --ipc host --gpus all -v /home/$USER:/home/$USER video_analyst/siamfcpp:vot-eval
6+
docker exec -it vot-eval bash
7+
```
8+
9+
P.S.
10+
- tmux bind key in container: Ctrl-x (avoid conflict with host)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
tqdm
2+
pylint
3+
yacs
4+
pillow
5+
future
6+
pycocotools
7+
pandas
8+
tensorboard
9+
ipython
10+
Cython==0.27.3
11+
yapf==0.28.0
12+
opencv-python==3.4.1.15
13+
numpy==1.16.0
14+
torch==1.1.0
15+
torchvision==0.3.0
16+
colorama==0.3.7
17+
numba==0.49.1
18+
matplotlib
19+
wget
20+
shapely==1.7.0
21+
scipy==1.2.1
22+
loguru==0.4.1
23+
scikit-image
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
2+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
3+
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
4+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
5+
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
6+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
7+
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
8+
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
9+
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
10+
11+
# 预发布软件源,不建议启用
12+
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
13+
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

0 commit comments

Comments
 (0)