-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
107 lines (88 loc) · 3.73 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
# 20220427 modified from headcase Dockerfile by MW to run the V4 HCE model
# Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty
# Latest release: Neurodocker version 0.8.0
# Timestamp: 2022/03/23 15:34:59 UTC
#
# Thank you for using Neurodocker. If you discover any issues
# or ways to improve this software, please submit an issue or
# pull request on our GitHub repository:
#
# https://github.com/ReproNim/neurodocker
#
FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu16.04
USER root
ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
&& apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
apt-utils \
bzip2 \
ca-certificates \
curl \
locales \
unzip \
git \
vim \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG="en_US.UTF-8" \
&& chmod 777 /opt && chmod a+s /opt \
&& mkdir -p /neurodocker \
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
&& echo 'set -e' >> "$ND_ENTRYPOINT" \
&& echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
fi \
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
ENTRYPOINT ["/neurodocker/startup.sh"]
RUN mkdir /home/hce_user
RUN mkdir /home/hce_user/hce_workdir
RUN mkdir /home/hce_user/hce_outdir
# add nonroot user
RUN groupadd -r hce_user && useradd --no-log-init -r -g hce_user hce_user
WORKDIR /home/hce_user/hce_workdir
# add yaml to my_docker folder and here
COPY ["./hce_gpu.yml", "/home/hce_user/hce_workdir/hce_gpu.yml"]
COPY ["./code/", "/home/hce_user/hce_workdir/code/"]
COPY ["./requirements.txt", "/home/hce_user/hce_workdir/requirements.txt"]
COPY ["./keras.json", "/home/hce_user/.keras/keras.json"]
COPY ["./theanorc", "/home/hce_user/.theanorc"]
COPY ["./bashrc", "/home/hce_user/.bashrc"]
ENV CONDA_DIR="/opt/miniconda-latest" \
PATH="/opt/miniconda-latest/bin:$PATH"
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
&& echo "Downloading Miniconda installer ..." \
&& conda_installer="/tmp/miniconda.sh" \
&& curl -fsSL --retry 5 -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash "$conda_installer" -b -p /opt/miniconda-latest \
&& rm -f "$conda_installer" \
&& conda update -yq -nbase conda \
&& conda config --system --prepend channels conda-forge \
&& conda config --system --set auto_update_conda false \
&& conda config --system --set show_channel_urls true \
&& sync && conda clean -y --all && sync \
# create dcetester from yaml file
&& conda env create -f /home/hce_user/hce_workdir/hce_gpu.yml \
&& sync && conda clean -y --all && sync
# install separate pip packages
RUN bash -c "source activate hce_gpu \
&& conda install https://repo.continuum.io/pkgs/main/linux-64/python-2.7.18-h02575d3_0.tar.bz2 \
&& conda install https://anaconda.org/conda-forge/pip/19.3.1/download/linux-64/pip-19.3.1-py27_0.tar.bz2 \
&& pip install --no-cache-dir \
"-r" \
"/home/hce_user/hce_workdir/requirements.txt"" \
&& rm -rf ~/.cache/pip/* \
&& sync \
&& sed -i '$isource activate hce_gpu' $ND_ENTRYPOINT
RUN chown -R hce_user /home/hce_user
# give hce_user access to gpus/cuda via 'video' group
RUN usermod -a -G video hce_user
RUN chown -R hce_user /neurodocker
# Set this env so script can tell if being run in docker container
ENV IN_A_DOCKER_CONTAINER=true