|
| 1 | +FROM poldracklab/fmriprep:unstable |
| 2 | + |
| 3 | +# net-tools needed for code-server |
| 4 | +# wget necessary for data downloads |
| 5 | +RUN apt-get update &&\ |
| 6 | + apt-get install -y \ |
| 7 | + net-tools \ |
| 8 | + wget |
| 9 | + |
| 10 | +# necessary to find fmriprep in /src/fmriprep |
| 11 | +ENV PYTHONNOUSERSITE=0 |
| 12 | + |
| 13 | +RUN cd /src/fmriprep &&\ |
| 14 | + pip install --no-use-pep517 -e .[all] |
| 15 | + |
| 16 | +# create freesurfer license |
| 17 | +RUN cd /tmp &&\ |
| 18 | + echo 'cHJpbnRmICJrcnp5c3p0b2YuZ29yZ29sZXdza2lAZ21haWwuY29tXG41MTcyXG4gKkN2dW12RVYzelRmZ1xuRlM1Si8yYzFhZ2c0RVxuIiA+IGxpY2Vuc2UudHh0Cg==' | base64 -d | sh |
| 19 | + |
| 20 | +ENV FS_LICENSE=/tmp/license.txt |
| 21 | + |
| 22 | +# set the fmriprep development variables |
| 23 | +ENV FMRIPREP_REGRESSION_SOURCE=/tmp/data/fmriprep_bold_truncated \ |
| 24 | + FMRIPREP_REGRESSION_TARGETS=/tmp/data/fmriprep_bold_mask \ |
| 25 | + FMRIPREP_REGRESSION_REPORTS=/tmp/data/reports \ |
| 26 | + FMRIPREP_DEV=1 |
| 27 | + |
| 28 | +# use flake8 as linter |
| 29 | +RUN conda install -y flake8 |
| 30 | + |
| 31 | +RUN mkdir -p /tmp/data |
| 32 | + |
| 33 | +# Download ds005 |
| 34 | +RUN wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \ |
| 35 | + -O ds005_downsampled.tar.gz "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/57f32a429ad5a101f977eb75" &&\ |
| 36 | + tar xvzf ds005_downsampled.tar.gz -C /tmp/data/ &&\ |
| 37 | + rm ds005_downsampled.tar.gz |
| 38 | + |
| 39 | +# Download ds210 |
| 40 | +RUN wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \ |
| 41 | + -O ds210_downsampled.tar.gz "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/5ae9e37b9a64d7000ce66c21" &&\ |
| 42 | + tar xvzf ds210_downsampled.tar.gz -C /tmp/data &&\ |
| 43 | + rm ds210_downsampled.tar.gz |
| 44 | + |
| 45 | +# Download ds054 |
| 46 | +RUN wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \ |
| 47 | + -O ds054_downsampled.tar.gz "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/57f32c22594d9001ef91bf9e" &&\ |
| 48 | + tar xvzf ds054_downsampled.tar.gz -C /tmp/data &&\ |
| 49 | + rm ds054_downsampled.tar.gz |
| 50 | + |
| 51 | +# Download freesurfer results for ds005 |
| 52 | +RUN mkdir -p /tmp/ds005/derivatives &&\ |
| 53 | + wget --retry-connrefused --waitretry=5 --read-timeout=20 --timeout=15 -t 0 -q \ |
| 54 | + -O ds005_derivatives_freesurfer.tar.gz "https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/58fe59eb594d900250960180" &&\ |
| 55 | + tar xvzf ds005_derivatives_freesurfer.tar.gz -C /tmp/ds005/derivatives &&\ |
| 56 | + rm ds005_derivatives_freesurfer.tar.gz |
| 57 | + |
| 58 | +# set up code-server (need net-tools for initialization) |
| 59 | + |
| 60 | + |
| 61 | +RUN curl -o /tmp/code-server.tar.gz -SL https://github.com/cdr/code-server/releases/download/2.preview.4-vsc1.37.0/code-server2.preview.4-vsc1.37.0-linux-x86_64.tar.gz |
| 62 | + |
| 63 | +RUN mkdir /src/codeserver &&\ |
| 64 | + tar -xvf /tmp/code-server.tar.gz -C /src/codeserver --strip-components=1 |
| 65 | + |
| 66 | +RUN /src/codeserver/code-server --install-extension eamodio.gitlens &&\ |
| 67 | + /src/codeserver/code-server --install-extension ms-python.python |
| 68 | + |
| 69 | + |
| 70 | +ENTRYPOINT ["/src/codeserver/code-server", "/src/fmriprep"] |
| 71 | + |
| 72 | +# usage example (assuming in local fmriprep directory): |
| 73 | +# |
| 74 | +# docker run -it \ |
| 75 | +# -p 127.0.0.1:8445:8080 \ |
| 76 | +# -v ${PWD}:/src/fmriprep \ |
| 77 | +# fmriprep_devel:latest |
| 78 | +# |
| 79 | +# then type 127.0.0.1:8445 in your browser address bar |
0 commit comments