Skip to content

Commit 8fca121

Browse files
authored
Merge pull request #117 from mgxd/fix/install
fix: update dockerfile and correctly install non-developer
2 parents 1fb2e17 + 33de1f7 commit 8fca121

File tree

2 files changed

+136
-35
lines changed

2 files changed

+136
-35
lines changed

Dockerfile

Lines changed: 135 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,136 @@
1+
# Generated by Neurodocker v0.3.2-1-gcfd3c6f.
2+
#
3+
# Thank you for using Neurodocker. If you discover any issues
4+
# or ways to improve this software, please submit an issue or
5+
# pull request on our GitHub repository:
6+
# https://github.com/kaczmarj/neurodocker
7+
#
8+
# Timestamp: 2017-12-01 19:04:23
19

2-
FROM continuumio/miniconda
3-
4-
MAINTAINER <[email protected]>
5-
6-
RUN apt-get update && apt-get upgrade -y && \
7-
apt-get install -y g++ pkg-config make && \
8-
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
9-
RUN (wget -O- http://neuro.debian.net/lists/jessie.us-nh.full | tee /etc/apt/sources.list.d/neurodebian.sources.list) && \
10-
apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9 && \
11-
apt-get update -qq && apt-get install -y git-annex-standalone && \
12-
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
13-
RUN conda install -y -c conda-forge nipype && \
14-
conda install cmake && \
15-
pip install https://github.com/moloney/dcmstack/archive/c12d27d2c802d75a33ad70110124500a83e851ee.zip && \
16-
pip install datalad && \
17-
conda clean -tipsy && rm -rf ~/.pip/
18-
RUN apt-get update && apt-get upgrade -y && \
19-
apt-get install -y pigz && \
20-
apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && \
21-
cd /tmp && git clone https://github.com/neurolabusc/dcm2niix.git && \
22-
cd dcm2niix && \
23-
git checkout 6ba27b9befcbae925209664bb8acbb00e266114a && \
24-
mkdir build && cd build && cmake -DBATCH_VERSION=ON .. && \
25-
make && make install && \
26-
cd / && rm -rf /tmp/dcm2niix
27-
28-
COPY bin/heudiconv /usr/local/bin/heudiconv
29-
RUN chmod +x /usr/local/bin/heudiconv
30-
RUN mkdir /heuristics
31-
COPY heuristics/convertall.py /heuristics
32-
RUN chmod +x /heuristics/convertall.py
33-
RUN git config --global user.email "[email protected]" && \
34-
git config --global user.name "Docker Almighty"
35-
36-
ENTRYPOINT ["/usr/local/bin/heudiconv"]
10+
FROM debian:stretch
11+
12+
ARG DEBIAN_FRONTEND=noninteractive
13+
14+
#----------------------------------------------------------
15+
# Install common dependencies and create default entrypoint
16+
#----------------------------------------------------------
17+
ENV LANG="en_US.UTF-8" \
18+
LC_ALL="C.UTF-8" \
19+
ND_ENTRYPOINT="/neurodocker/startup.sh"
20+
RUN apt-get update -qq && apt-get install -yq --no-install-recommends \
21+
apt-utils bzip2 ca-certificates curl locales unzip \
22+
&& apt-get clean \
23+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
24+
&& localedef --force --inputfile=en_US --charmap=UTF-8 C.UTF-8 \
25+
&& chmod 777 /opt && chmod a+s /opt \
26+
&& mkdir -p /neurodocker \
27+
&& if [ ! -f "$ND_ENTRYPOINT" ]; then \
28+
echo '#!/usr/bin/env bash' >> $ND_ENTRYPOINT \
29+
&& echo 'set +x' >> $ND_ENTRYPOINT \
30+
&& echo 'if [ -z "$*" ]; then /usr/bin/env bash; else $*; fi' >> $ND_ENTRYPOINT; \
31+
fi \
32+
&& chmod -R 777 /neurodocker && chmod a+s /neurodocker
33+
ENTRYPOINT ["/neurodocker/startup.sh"]
34+
35+
RUN apt-get update -qq \
36+
&& apt-get install -y -q --no-install-recommends git \
37+
gcc \
38+
pigz \
39+
&& apt-get clean \
40+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
41+
42+
#------------------------
43+
# Install dcm2niix v1.0.20171017
44+
#------------------------
45+
WORKDIR /tmp
46+
RUN deps='cmake g++ gcc git make pigz zlib1g-dev' \
47+
&& apt-get update -qq && apt-get install -yq --no-install-recommends $deps \
48+
&& apt-get clean \
49+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
50+
&& mkdir dcm2niix \
51+
&& curl -sSL https://github.com/rordenlab/dcm2niix/tarball/v1.0.20171017 | tar xz -C dcm2niix --strip-components 1 \
52+
&& mkdir dcm2niix/build && cd dcm2niix/build \
53+
&& cmake .. && make \
54+
&& make install \
55+
&& rm -rf /tmp/*
56+
57+
COPY [".", "/src/heudiconv"]
58+
59+
#------------------
60+
# Install Miniconda
61+
#------------------
62+
ENV CONDA_DIR=/opt/conda \
63+
PATH=/opt/conda/bin:$PATH
64+
RUN echo "Downloading Miniconda installer ..." \
65+
&& miniconda_installer=/tmp/miniconda.sh \
66+
&& curl -sSL --retry 5 -o $miniconda_installer https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
67+
&& /bin/bash $miniconda_installer -b -p $CONDA_DIR \
68+
&& rm -f $miniconda_installer \
69+
&& conda config --system --prepend channels conda-forge \
70+
&& conda config --system --set auto_update_conda false \
71+
&& conda config --system --set show_channel_urls true \
72+
&& conda clean -tipsy && sync
73+
74+
#-------------------------
75+
# Create conda environment
76+
#-------------------------
77+
RUN conda create -y -q --name neuro python=2 \
78+
traits=4.6.0 \
79+
&& sync && conda clean -tipsy && sync \
80+
&& /bin/bash -c "source activate neuro \
81+
&& pip install -q --no-cache-dir https://github.com/moloney/dcmstack/tarball/master \
82+
/src/heudiconv[all]" \
83+
&& sync \
84+
&& sed -i '$isource activate neuro' $ND_ENTRYPOINT
85+
86+
ENTRYPOINT ["/neurodocker/startup.sh", "heudiconv"]
87+
88+
#--------------------------------------
89+
# Save container specifications to JSON
90+
#--------------------------------------
91+
RUN echo '{ \
92+
\n "pkg_manager": "apt", \
93+
\n "check_urls": true, \
94+
\n "instructions": [ \
95+
\n [ \
96+
\n "base", \
97+
\n "debian:stretch" \
98+
\n ], \
99+
\n [ \
100+
\n "install", \
101+
\n [ \
102+
\n "git", \
103+
\n "gcc", \
104+
\n "pigz" \
105+
\n ] \
106+
\n ], \
107+
\n [ \
108+
\n "dcm2niix", \
109+
\n { \
110+
\n "version": "v1.0.20171017" \
111+
\n } \
112+
\n ], \
113+
\n [ \
114+
\n "copy", \
115+
\n [ \
116+
\n ".", \
117+
\n "/src/heudiconv" \
118+
\n ] \
119+
\n ], \
120+
\n [ \
121+
\n "miniconda", \
122+
\n { \
123+
\n "env_name": "neuro", \
124+
\n "conda_install": "python=2 traits=4.6.0", \
125+
\n "pip_install": "https://github.com/moloney/dcmstack/tarball/master /src/heudiconv[all]", \
126+
\n "activate": true \
127+
\n } \
128+
\n ], \
129+
\n [ \
130+
\n "entrypoint", \
131+
\n "/neurodocker/startup.sh heudiconv" \
132+
\n ] \
133+
\n ], \
134+
\n "generation_timestamp": "2017-12-01 19:04:23", \
135+
\n "neurodocker_version": "0.3.2-1-gcfd3c6f" \
136+
\n}' > /neurodocker/neurodocker_specs.json

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def findsome(subdir, extensions):
3939
version=ldict['__version__'],
4040
description=ldict['__description__'],
4141
long_description=ldict['__longdesc__'],
42+
packages=find_packages(),
4243
entry_points={'console_scripts': [
4344
'heudiconv=heudiconv.cli.run:main',
4445
'heudiconv_monitor=heudiconv.cli.monitor:main',

0 commit comments

Comments
 (0)