|
| 1 | +FROM neurodebian:bionic-non-free AS dcan-hcp |
| 2 | +FROM ghcr.io/fcp-indi/c-pac_templates:latest as c-pac_templates |
| 3 | + |
| 4 | +ARG DEBIAN_FRONTEND=noninteractive |
| 5 | + |
| 6 | +# Adding DCAN dependencies & HCP code |
| 7 | +RUN apt-get update && \ |
| 8 | + apt-get install -y git && \ |
| 9 | + mkdir -p /opt/dcan-tools && \ |
| 10 | + git clone -b 'v2.0.0' --single-branch --depth 1 https://github.com/DCAN-Labs/DCAN-HCP.git /opt/dcan-tools/pipeline |
| 11 | + |
| 12 | +# using neurodebian runtime as parent image |
| 13 | +FROM neurodebian:bionic-non-free |
| 14 | +LABEL org.opencontainers.image.description "NOT INTENDED FOR USE OTHER THAN AS A STAGE IMAGE IN A MULTI-STAGE BUILD \ |
| 15 | +Ubuntu Bionic base image" |
| 16 | +ARG DEBIAN_FRONTEND=noninteractive |
| 17 | + |
| 18 | +ENV TZ=America/New_York |
| 19 | + |
| 20 | +# Creating usergroup and user |
| 21 | +# Allow users to update / create themselves |
| 22 | +# Installing system requirments, the BIDS validator & minconda |
| 23 | +RUN groupadd -r c-pac && \ |
| 24 | + useradd -r -g c-pac c-pac_user && \ |
| 25 | + mkdir -p /home/c-pac_user/ && \ |
| 26 | + chown -R c-pac_user:c-pac /home/c-pac_user && \ |
| 27 | + chmod 777 / && \ |
| 28 | + chmod ugo+w /etc/passwd && \ |
| 29 | + apt-get update && \ |
| 30 | + apt-get install -y --no-install-recommends \ |
| 31 | + apt-utils \ |
| 32 | + apt-transport-https \ |
| 33 | + bc \ |
| 34 | + build-essential \ |
| 35 | + bzip2 \ |
| 36 | + ca-certificates \ |
| 37 | + cmake \ |
| 38 | + curl \ |
| 39 | + dh-autoreconf \ |
| 40 | + git \ |
| 41 | + gnupg \ |
| 42 | + graphviz \ |
| 43 | + graphviz-dev \ |
| 44 | + gsl-bin \ |
| 45 | + libcanberra-gtk-module \ |
| 46 | + libexpat1-dev \ |
| 47 | + libgiftiio-dev \ |
| 48 | + libglib2.0-dev \ |
| 49 | + libglu1-mesa \ |
| 50 | + libglu1-mesa-dev \ |
| 51 | + libjpeg-progs \ |
| 52 | + libgl1-mesa-dri \ |
| 53 | + libglw1-mesa \ |
| 54 | + libgsl-dev \ |
| 55 | + libmotif-dev \ |
| 56 | + libtool \ |
| 57 | + libx11-dev \ |
| 58 | + libxext-dev \ |
| 59 | + libxft2 \ |
| 60 | + libxft-dev \ |
| 61 | + libxi-dev \ |
| 62 | + libxml2 \ |
| 63 | + libxml2-dev \ |
| 64 | + libxmu-dev \ |
| 65 | + libxmu-headers \ |
| 66 | + libxpm-dev \ |
| 67 | + libxslt1-dev \ |
| 68 | + locales \ |
| 69 | + m4 \ |
| 70 | + make \ |
| 71 | + mesa-common-dev \ |
| 72 | + mesa-utils \ |
| 73 | + netpbm \ |
| 74 | + ninja-build \ |
| 75 | + openssh-client \ |
| 76 | + pkg-config \ |
| 77 | + rsync \ |
| 78 | + software-properties-common \ |
| 79 | + tcsh \ |
| 80 | + unzip \ |
| 81 | + vim \ |
| 82 | + wget \ |
| 83 | + x11proto-xext-dev \ |
| 84 | + x11proto-print-dev \ |
| 85 | + xauth \ |
| 86 | + xutils-dev \ |
| 87 | + xvfb \ |
| 88 | + zlib1g-dev && \ |
| 89 | + export XDG_CONFIG_HOME=/usr/bin && \ |
| 90 | + curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash && \ |
| 91 | + export NVM_DIR=/usr/bin/nvm && \ |
| 92 | + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \ |
| 93 | + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" && \ |
| 94 | + nvm install 12.12.0 && \ |
| 95 | + nvm use 12.12.0 && \ |
| 96 | + nvm alias default 12.12.0 && \ |
| 97 | + npm install --global npm@^7 && \ |
| 98 | + npm install -g bids-validator && \ |
| 99 | + curl -sLo /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb && \ |
| 100 | + dpkg -i /tmp/libpng12.deb && \ |
| 101 | + rm /tmp/libpng12.deb && \ |
| 102 | + add-apt-repository --yes ppa:zeehio/libxp && \ |
| 103 | + apt-get update && \ |
| 104 | + apt-get install --no-install-recommends \ |
| 105 | + libxp6 \ |
| 106 | + libxp-dev && \ |
| 107 | + add-apt-repository --remove --yes ppa:zeehio/libxp && \ |
| 108 | + apt-get update && \ |
| 109 | + curl -sO https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh && \ |
| 110 | + bash Miniconda3-py37_4.8.2-Linux-x86_64.sh -b -p /usr/local/miniconda && \ |
| 111 | + rm Miniconda3-py37_4.8.2-Linux-x86_64.sh && chmod -R 777 /usr/local/miniconda && \ |
| 112 | + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ |
| 113 | + echo $TZ > /etc/timezone && \ |
| 114 | + sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ |
| 115 | + dpkg-reconfigure --frontend=noninteractive locales && \ |
| 116 | + update-locale LANG="en_US.UTF-8" && \ |
| 117 | + chmod 777 /opt && \ |
| 118 | + chmod a+s /opt |
| 119 | + |
| 120 | +ENV PATH=/usr/bin/nvm/versions/node/v12.12.0/bin:/usr/local/miniconda/bin:$PATH |
| 121 | + |
| 122 | +# Installing conda dependencies, torch & Python dependencies |
| 123 | +COPY requirements.txt /opt/requirements.txt |
| 124 | +RUN conda update conda -y && \ |
| 125 | + conda install nomkl && \ |
| 126 | + conda install -y \ |
| 127 | + blas \ |
| 128 | + cython \ |
| 129 | + matplotlib==3.1.3 \ |
| 130 | + networkx==2.4 \ |
| 131 | + nose==1.3.7 \ |
| 132 | + numpy==1.16.4 \ |
| 133 | + pandas==0.23.4 \ |
| 134 | + scipy==1.4.1 \ |
| 135 | + traits==4.6.0 \ |
| 136 | + wxpython \ |
| 137 | + pip && \ |
| 138 | + pip install \ |
| 139 | + torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html && \ |
| 140 | + pip install --upgrade setuptools && \ |
| 141 | + pip install --upgrade pip && \ |
| 142 | + pip install -r /opt/requirements.txt && \ |
| 143 | + pip install xvfbwrapper && \ |
| 144 | + curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ |
| 145 | + apt-get install -y --no-install-recommends git-lfs && \ |
| 146 | + git lfs install |
| 147 | + |
| 148 | +# Installing C-PAC templates and atlases |
| 149 | +COPY --from=c-pac_templates /cpac_templates /cpac_templates |
| 150 | +COPY --from=dcan-hcp /opt/dcan-tools/pipeline/global /opt/dcan-tools/pipeline/global |
| 151 | +COPY --from=ghcr.io/fcp-indi/c-pac/neuroparc:v1.0-human /ndmg_atlases /ndmg_atlases |
| 152 | + |
| 153 | +# Installing surface files for downsampling |
| 154 | +COPY --from=c-pac_templates /opt/dcan-tools/pipeline/global/templates/standard_mesh_atlases/ /opt/dcan-tools/pipeline/global/templates/standard_mesh_atlases/ |
| 155 | +COPY --from=c-pac_templates /opt/dcan-tools/pipeline/global/templates/28224_Greyordinates/ /opt/dcan-tools/pipeline/global/templates/28224_Greyordinates/ |
| 156 | +COPY --from=c-pac_templates /opt/dcan-tools/pipeline/global/templates/8617_Greyordinates/ /opt/dcan-tools/pipeline/global/templates/8617_Greyordinates/ |
| 157 | + |
| 158 | +ENTRYPOINT ["/bin/bash"] |
| 159 | + |
| 160 | +# Link libraries for Singularity images |
| 161 | +RUN ldconfig && \ |
| 162 | + apt-get clean && \ |
| 163 | + apt-get autoremove -y && \ |
| 164 | + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 165 | + |
| 166 | +# set user |
| 167 | +USER c-pac_user |
0 commit comments