1
+ FROM neurodebian:DL_DIST
2
+ MAINTAINER Yaroslav Halchenko <
[email protected] >
3
+
4
+ USER root
5
+
6
+ # Speed up installation using our apt cacher - modify conf/etc/apt/apt.conf.d/99apt-cacher if you have any
7
+ RUN mkdir -p /etc/apt/apt.conf.d/
8
+ COPY conf/etc/apt/apt.conf.d/99apt-cacher /etc/apt/apt.conf.d/99apt-cacher
9
+ RUN chmod a+r /etc/apt/apt.conf.d/99apt-cacher
10
+
11
+ # Make deb-src avail
12
+ # RUN sed -i -e 's,^deb\(.*\),deb\1\ndeb-src\1,g' /etc/apt/sources.list.d/neurodebian.sources.list /etc/apt/sources.list
13
+
14
+ # Make contrib and non-free avail for FSL
15
+ RUN sed -i -e 's, main$, main contrib non-free,g' /etc/apt/sources.list.d/neurodebian.sources.list
16
+
17
+ # Assure popcon doesn't kick in
18
+ RUN bash -c "echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections -"
19
+
20
+ RUN apt-get update
21
+ # Use bash for extended syntax
22
+ RUN apt-get install -y -q eatmydata
23
+ # Some rudimentary tools if we need to do anything within docker and curl and unzip needed for setting up conda
24
+ RUN bash -c "eatmydata apt-get install -y -q vim less man-db curl unzip bzip2"
25
+ # Run additional lines, primarily to setup/enable snapshots repository etc
26
+ RUN bash -c "DL_APT"
27
+ # Install fsl-complete
28
+ #RUN bash -c "eatmydata apt-get install -y -q fsl-complete"
29
+ # We might be just fine with the core here
30
+ RUN bash -c "eatmydata apt-get install -y -q fsl-core fsl-first-data"
31
+
32
+ RUN apt-get clean
33
+
34
+ # Setting up conda environment given simple_workflow specifications
35
+ WORKDIR /opt/repronim/simple_workflow
36
+ RUN curl -Ok https://raw.githubusercontent.com/ReproNim/simple_workflow/e4063fa95cb494da496565ec27c4ffe8a4901c45/Simple_Prep.sh
37
+ # conda installations take way too long -- might benefit from setting up
38
+ # to use proxy
39
+ # http://stackoverflow.com/a/31120854
40
+ RUN bash Simple_Prep.sh
41
+
42
+ #
43
+ # There seems to be no easy consistent way to load our customizations to env
44
+ # variables for both interactive and non-interactive shells. So let's create
45
+ # a file which would have all the necessary tuneups which would be passed
46
+ # explicitly into bash
47
+ #
48
+ 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'
49
+
50
+ # Make fsl available in the containers by pointing ENV variable to it
51
+ # which both bash and dash (ubuntu) should warrant
52
+ # ENV ENV /etc/fsl/fsl.sh
53
+ # not effective :-/ for now let's try to place in bashrc
54
+ # RUN bash -c "echo '. /etc/fsl/fsl.sh' >> /etc/bash.bashrc"
55
+
56
+ # Tune the environment variables
57
+ #ENV PATH /root/miniconda2/bin:$PATH
58
+ # RUN bash -c "echo 'source activate bh_demo' >> /etc/bash.bashrc"
59
+
60
+ # Tune bash behavior so it loads our environment setup even in non-interactive mode
61
+ ENV ENV /opt/repronim/simple_workflow/setup_environment
62
+ RUN bash -c 'echo -e ". /opt/repronim/simple_workflow/setup_environment" >> /etc/profile'
63
+
64
+ # Let's setup user matching user
65
+ ## RUN groupadd --gid DL_GID -r DL_USER && useradd -m --uid DL_UID -g DL_USER DL_USER
66
+
67
+ ## CMD ["/bin/bash"]
0 commit comments