-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile_exec
50 lines (36 loc) · 1.46 KB
/
Dockerfile_exec
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
# Base image
FROM ubuntu:18.04
USER root
ENV ND_ENTRYPOINT="/neurodocker/startup.sh"
RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
&& 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 'source activate accel' >> "$ND_ENTRYPOINT" \
&& echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
fi \
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
# Get base utilities
RUN apt-get update \
&& apt-get -y install curl \
&& chmod 777 /opt
# Conda install
ENV PATH="/opt/miniconda-latest/bin:$PATH"
RUN useradd --create-home --shell /bin/bash coder
USER coder
RUN export PATH="/opt/miniconda-latest/bin:$PATH" \
&& 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
RUN mkdir /home/coder/projects
WORKDIR /home/coder/projects
COPY . /home/coder/projects/
RUN conda env create -f environment.yml
RUN bash -c 'conda init && . /home/coder/.bashrc && . activate accel && pip install -e /home/coder/projects'
USER root
RUN chown -R coder:coder /home/coder/projects
USER coder
# Run as executable
ENTRYPOINT ["/neurodocker/startup.sh", "accel_transform"]