forked from ReproNim/simple_workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simple_Prep_docker-Dockerfile.in
67 lines (53 loc) · 2.86 KB
/
Simple_Prep_docker-Dockerfile.in
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
FROM neurodebian:DL_DIST
MAINTAINER Yaroslav Halchenko <[email protected]>
USER root
# Speed up installation using our apt cacher - modify conf/etc/apt/apt.conf.d/99apt-cacher if you have any
RUN mkdir -p /etc/apt/apt.conf.d/
COPY conf/etc/apt/apt.conf.d/99apt-cacher /etc/apt/apt.conf.d/99apt-cacher
RUN chmod a+r /etc/apt/apt.conf.d/99apt-cacher
# Make deb-src avail
# RUN sed -i -e 's,^deb\(.*\),deb\1\ndeb-src\1,g' /etc/apt/sources.list.d/neurodebian.sources.list /etc/apt/sources.list
# Make contrib and non-free avail for FSL
RUN sed -i -e 's, main$, main contrib non-free,g' /etc/apt/sources.list.d/neurodebian.sources.list
# Assure popcon doesn't kick in
RUN bash -c "echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections -"
RUN apt-get update
# Use bash for extended syntax
RUN apt-get install -y -q eatmydata
# Some rudimentary tools if we need to do anything within docker and curl and unzip needed for setting up conda
RUN bash -c "eatmydata apt-get install -y -q vim less man-db curl unzip bzip2"
# Run additional lines, primarily to setup/enable snapshots repository etc
RUN bash -c "DL_APT"
# Install fsl-complete
#RUN bash -c "eatmydata apt-get install -y -q fsl-complete"
# We might be just fine with the core here
RUN bash -c "eatmydata apt-get install -y -q fsl-core fsl-first-data"
RUN apt-get clean
# Setting up conda environment given simple_workflow specifications
WORKDIR /opt/repronim/simple_workflow
RUN curl -Ok https://raw.githubusercontent.com/ReproNim/simple_workflow/e4063fa95cb494da496565ec27c4ffe8a4901c45/Simple_Prep.sh
# conda installations take way too long -- might benefit from setting up
# to use proxy
# http://stackoverflow.com/a/31120854
RUN bash Simple_Prep.sh
#
# There seems to be no easy consistent way to load our customizations to env
# variables for both interactive and non-interactive shells. So let's create
# a file which would have all the necessary tuneups which would be passed
# explicitly into bash
#
RUN bash -c 'echo -e "echo IN setup_environments\n. /etc/fsl/fsl.sh\nexport PATH=/root/miniconda2/bin:\$PATH\nsource activate bh_demo\n" > setup_environment'
# Make fsl available in the containers by pointing ENV variable to it
# which both bash and dash (ubuntu) should warrant
# ENV ENV /etc/fsl/fsl.sh
# not effective :-/ for now let's try to place in bashrc
# RUN bash -c "echo '. /etc/fsl/fsl.sh' >> /etc/bash.bashrc"
# Tune the environment variables
#ENV PATH /root/miniconda2/bin:$PATH
# RUN bash -c "echo 'source activate bh_demo' >> /etc/bash.bashrc"
# Tune bash behavior so it loads our environment setup even in non-interactive mode
ENV ENV /opt/repronim/simple_workflow/setup_environment
RUN bash -c 'echo -e ". /opt/repronim/simple_workflow/setup_environment" >> /etc/profile'
# Let's setup user matching user
## RUN groupadd --gid DL_GID -r DL_USER && useradd -m --uid DL_UID -g DL_USER DL_USER
## CMD ["/bin/bash"]