-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.antsr
62 lines (58 loc) · 2.46 KB
/
Dockerfile.antsr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Docker file to build ANTsR from the rocker/rstudio base image
# using the devtools method to build from source.
FROM rocker/rstudio:3.6.1
LABEL maintainer="Dorian Pustina"
LABEL org.label-schema.maintainer="Dorian Pustina"
LABEL org.label-schema.url="https://github.com/ANTsX/ANTsR"
LABEL org.label-schema.vcs-url="https://github.com/ANTsX/ANTsR"
LABEL org.label-schema.vendor=""
RUN \
cat /etc/*release \
&& echo "Building user:" `whoami` \
&& echo "Number of cores:" $(nproc) \
\
&& START=$(date +%s) \
\
&& apt-get install -f \
&& apt update \
\
&& NOW=$(date +%s) && DIFF=$(( $NOW - $START )) && echo "Elapsed $DIFF seconds..." \
\
&& apt install -y \
curl \
git \
zlib1g-dev \
libxml2 \
libxml2-dev \
libssl-dev \
libcurl4-gnutls-dev \
libssh2-1-dev \
libgit2-dev \
libv8-dev \
\
&& NOW=$(date +%s) && DIFF=$(( $NOW - $START )) && echo "Elapsed $DIFF seconds..." \
\
&& wget https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-Linux-x86_64.sh \
&& sh cmake-3.15.5-Linux-x86_64.sh --skip-license \
&& rm -Rf cmake* \
&& Rscript -e "install.packages('devtools')" \
&& NOW=$(date +%s) && DIFF=$(( $NOW - $START )) && echo "Elapsed $DIFF seconds..." \
&& Rscript -e "install.packages(c('misc3d', 'pixmap', 'colormap'))" \
&& NOW=$(date +%s) && DIFF=$(( $NOW - $START )) && echo "Elapsed $DIFF seconds..." \
&& Rscript -e "devtools::install_github('ANTsX/ANTsR')" \
\
&& NOW=$(date +%s) && DIFF=$(( $NOW - $START )) && echo "Elapsed $DIFF seconds..." \
\
&& sed -i 's/rocker\/rstudio/dorianps\/antsr/g' /etc/cont-init.d/userconf \
&& mkdir -p /home/rstudio/mydata \
&& echo "ANTsR" > /home/rstudio/.Rpackagedisplay \
&& echo "ANTsRCore" >> /home/rstudio/.Rpackagedisplay \
&& echo "ITKR" >> /home/rstudio/.Rpackagedisplay \
&& echo "setwd('/home/rstudio/mydata')" > /home/rstudio/.Rprofile \
&& echo "Sys.setenv(ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = system('nproc', intern=TRUE) )" >> /home/rstudio/.Rprofile \
&& echo "message(paste('CPU cores/threads available:', system('nproc', intern=TRUE), '\\\n'))" >> /home/rstudio/.Rprofile \
&& echo "tmp = utils::capture.output( sessioninfo::package_info( utils::read.table('/home/rstudio/.Rpackagedisplay', as.is=TRUE)\$V1, dependencies = FALSE) )" >> /home/rstudio/.Rprofile \
&& echo "for (line in tmp) message(line)" >> /home/rstudio/.Rprofile \
&& echo "rm(list=c('line','tmp'))" >> /home/rstudio/.Rprofile \
&& echo "suppressPackageStartupMessages(library(ANTsR))" >> /home/rstudio/.Rprofile \
&& chown -R rstudio:rstudio /home/rstudio/