Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Build from an R base image #384

Merged
merged 4 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
FROM rocker/tidyverse:4.2.3 AS builder

COPY . /opt/src/ANTsR

WORKDIR /opt/src

RUN git clone --depth 1 https://github.com/stnava/ITKR.git && \
git clone --depth 1 https://github.com/ANTsX/ANTsRCore.git

# Get CMake
RUN wget https://github.com/Kitware/CMake/releases/download/v3.25.3/cmake-3.25.3-linux-x86_64.sh && \
chmod u+x cmake-3.25.3-linux-x86_64.sh && \
./cmake-3.25.3-linux-x86_64.sh --skip-license --prefix=/usr/local && \
rm ./cmake-3.25.3-linux-x86_64.sh

# Minimal dependencies, will not enable all functionality
# Some of these already exist in the rocker image, but install
# anyway in case base image changes
RUN R_REMOTES_NO_ERRORS_FROM_WARNINGS=true \
Rscript -e "install.packages( \
c('Rcpp', \
'RcppEigen', \
'magrittr', \
'rsvd', \
'magic', \
'psych'), dependencies = TRUE )"

RUN R CMD INSTALL ITKR && \
R CMD INSTALL ANTsRCore && \
R CMD INSTALL ANTsR

# Some packages were removed from CRAN and need a github install
RUN R_REMOTES_NO_ERRORS_FROM_WARNINGS=true \
Rscript -e "library(devtools)" \
-e "install_github('cran/ifultools')" \
-e "install_github('cran/DMwR')"

RUN R_REMOTES_NO_ERRORS_FROM_WARNINGS=true \
Rscript -e "\
install.packages(c( \
'abind', \
'BGLR', \
'caret', \
'cluster', \
'corpcor', \
'dplyr', \
'e1071', \
'extremevalues', \
'fastICA', \
'FNN', \
'fpc', \
'ggplot2', \
'glasso', \
'glmnet', \
'grid', \
'hdf5r', \
'igraph', \
'irlba', \
'knitr', \
'mFilter', \
'misc3d', \
'moments', \
'networkD3', \
'pixmap', \
'png', \
'pracma', \
'R.matlab', \
'randomForest', \
'RcppHNSW', \
'rgl', \
'rmarkdown', \
'robust', \
'robustbase', \
'signal', \
'sna', \
'testthat', \
'viridis', \
'visreg', \
'wmtsa', \
'xgboost' \
), repos = 'https://cloud.r-project.org')"

# Additional dependencies
# Derived from remotes::local_package_deps
FROM rocker/tidyverse:4.2.3 AS runtime

COPY --from=builder /usr/local/lib/R/site-library/ /usr/local/lib/R/site-library/

ENV R_DEFAULT_PACKAGES="datasets,utils,grDevices,graphics,stats,methods,ANTsR"
ENV ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1

WORKDIR /

CMD ["R"]
58 changes: 0 additions & 58 deletions docker/Dockerfile

This file was deleted.

54 changes: 0 additions & 54 deletions docker/README.md

This file was deleted.

40 changes: 0 additions & 40 deletions docker/ubuntuRKey.txt

This file was deleted.