-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
125 lines (109 loc) · 3.31 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
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
# prep apt-get and cudnn
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils && \
rm -rf /var/lib/apt/lists/*
# install requirements
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils \
bc \
bzip2 \
ca-certificates \
curl \
git \
libgdal-dev \
libssl-dev \
libffi-dev \
libncurses-dev \
libgl1 \
jq \
nfs-common \
parallel \
python-dev \
python-pip \
python-wheel \
python-setuptools \
unzip \
vim \
tmux \
wget \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-c"]
ENV PATH /opt/conda/bin:$PATH
# install anaconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda clean -tipsy && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
ENV TINI_VERSION v0.16.1
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini
# use conda-forge instead of default channel
RUN conda update conda && \
#conda config --remove channels defaults && \
conda config --add channels conda-forge
# set up conda environment and add to $PATH
RUN conda create -n cresi python=3.6 \
&& echo "source activate cresi" > ~/.bashrc
ENV PATH /opt/conda/envs/cresi/bin:$PATH
RUN mkdir -p /root/.torch/models
RUN pip install torch==1.1.0 -f https://download.pytorch.org/whl/torch_stable
RUN pip install torchvision==0.4.0 --no-deps
RUN pip install albumentations==0.4.1
RUN pip install pretrainedmodels
RUN pip install tensorboardX \
&& pip install torchsummary \
&& pip install utm \
&& pip install numba
RUN pip uninstall apex
RUN git clone https://github.com/NVIDIA/apex
RUN sed -i 's/check_cuda_torch_binary_vs_bare_metal(torch.utils.cpp_extension.CUDA_HOME)/pass/g' apex/setup.py
RUN pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" /apex
RUN conda install -n cresi \
awscli \
affine \
pyhamcrest \
cython \
fiona \
h5py \
ncurses \
jupyter \
jupyterlab \
ipykernel \
matplotlib \
ncurses \
numpy \
statsmodels \
pandas \
pillow \
pip \
scipy \
scikit-image \
scikit-learn \
shapely \
rtree \
testpath \
tqdm \
pandas \
opencv \
&& conda clean -p \
&& conda clean -t \
&& conda clean --yes --all
ENV LD_LIBRARY_PATH /miniconda/lib:${LD_LIBRARY_PATH}
RUN apt update
RUN pip install efficientnet_pytorch
RUN pip install Pillow==6.1
# add a jupyter kernel for the conda environment in case it's wanted
RUN source activate cresi && python -m ipykernel.kernelspec
# open ports for jupyterlab and tensorboard
EXPOSE 8888 6006
WORKDIR /work
COPY . /work/
RUN chmod +x run.sh
ENTRYPOINT ["./run.sh"]