Skip to content

Commit

Permalink
fixed dockerfile install, added docker requirements file
Browse files Browse the repository at this point in the history
  • Loading branch information
jvarada committed Sep 1, 2017
1 parent 01a27fb commit ab2184a
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 22 deletions.
28 changes: 28 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# python cache
__pycache__

# python distribution
fmrif_tools.egg-info
src

# git
.git
.gitignore

# other
docs

# config req files
requirements.in
docker_requirements.in
dev_requirements.in

# Non-docker req files
requirements.txt
dev_requirements.txt

# Mac files
.DS_Store

# IDE
.idea
51 changes: 39 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,57 @@
FROM neurodebian:wheezy
FROM neurodebian:trusty

# Add dcm2niix and lbgdcm (taken from scitran dcm2niix dockerfile)
RUN apt-get update -qq \
&& apt-get install -y \
dcm2niix \
libgdcm-tools \
git \
curl \
build-essential \
cmake \
pkg-config \
libgdcm-tools=2.2.4-1.1ubuntu4 \
bsdtar \
unzip \
pigz \
bzip2 \
gzip \
wget
wget \
jq \
libgl1-mesa-glx

# Compile DCM2NIIX from source (latest commit as of Sept. 1, 2017)
ENV DCMCOMMIT=988d16b7327028d46ed7f45f00cc704254a91446
RUN curl -#L https://github.com/rordenlab/dcm2niix/archive/$DCMCOMMIT.zip | bsdtar -xf- -C /usr/local
WORKDIR /usr/local/dcm2niix-${DCMCOMMIT}/build
RUN cmake -DUSE_OPENJPEG=ON ../ && \
make && \
make install


# Install and setup miniconda (taken from mriqc Dockerfile)
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-4.3.11-Linux-x86_64.sh && \
bash Miniconda3-4.3.11-Linux-x86_64.sh -b -p /usr/local/miniconda && \
rm Miniconda3-4.3.11-Linux-x86_64.sh
RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-4.3.21-Linux-x86_64.sh && \
bash Miniconda3-4.3.21-Linux-x86_64.sh -b -p /usr/local/miniconda && \
rm Miniconda3-4.3.21-Linux-x86_64.sh

ENV PATH=/usr/local/miniconda/bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8

COPY . /root/src/fmrif_tools
RUN cd /root/src/fmrif_tools && \
pip install -r requirements.txt && \
RUN conda install -y \
numpy==1.13.1 \
matplotlib==2.0.2 \
pandas==0.20.3; \
sync && \
chmod +x /usr/local/miniconda/bin/* && \
conda clean --all -y; sync && \
python -c "from matplotlib import font_manager" && \
sed -i 's/\(backend *: \).*$/\1Agg/g' $( python -c "import matplotlib; print(matplotlib.matplotlib_fname())" )

WORKDIR /usr/local/src/fmrif_tools
COPY . /usr/local/src/fmrif_tools
RUN cd /usr/local/src/fmrif_tools && \
pip install -r docker_requirements.txt && \
pip install . && \
rm -rf ~/.cache/pip

ENTRYPOINT["/usr/local/miniconda/bin/oxy2bids"]
RUN ldconfig

ENTRYPOINT ["/usr/local/miniconda/bin/oxy2bids"]
5 changes: 3 additions & 2 deletions __about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 2.7',
]

REQUIRES = [
'matplotlib == 2.0.2',
'pandas == 0.20.1',
'pandas == 0.20.3',
'pydicom == 0.9.9',
'numpy == 1.13.0',
'numpy == 1.13.1',
'bioread == 1.0.4',
]
4 changes: 2 additions & 2 deletions dev_requirements.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pandas==0.20.1
pandas==0.20.3
matplotlib==2.0.2
bioread==1.0.4
pydicom==0.9.9
numpy==1.13.0
numpy==1.13.1
jupyter
notebook
4 changes: 2 additions & 2 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ mistune==0.7.4 # via nbconvert
nbconvert==5.3.0 # via jupyter, notebook
nbformat==4.4.0 # via ipywidgets, nbconvert, notebook
notebook==5.0.0
numpy==1.13.0
pandas==0.20.1
numpy==1.13.1
pandas==0.20.3
pandocfilters==1.4.2 # via nbconvert
pexpect==4.2.1 # via ipython
pickleshare==0.7.4 # via ipython
Expand Down
2 changes: 2 additions & 0 deletions docker_requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pydicom==0.9.9
bioread==1.0.4
9 changes: 9 additions & 0 deletions docker_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file docker_requirements.txt docker_requirements.in
#
bioread==1.0.4
numpy==1.13.1 # via bioread
pydicom==0.9.9
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
matplotlib==2.0.2
pandas==0.20.1
pandas==0.20.3
pydicom==0.9.9
numpy==1.13.0
numpy==1.13.1
bioread==1.0.4
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
bioread==1.0.4
cycler==0.10.0 # via matplotlib
matplotlib==2.0.2
numpy==1.13.0
pandas==0.20.1
numpy==1.13.1
pandas==0.20.3
pydicom==0.9.9
pyparsing==2.2.0 # via matplotlib
python-dateutil==2.6.1 # via matplotlib, pandas
Expand Down

0 comments on commit ab2184a

Please sign in to comment.