Skip to content

Instantly share code, notes, and snippets.

@shabbychef
Created December 30, 2019 00:34
Show Gist options
  • Save shabbychef/efaa048f0f715dcf89fd39f2e28a402d to your computer and use it in GitHub Desktop.
Save shabbychef/efaa048f0f715dcf89fd39f2e28a402d to your computer and use it in GitHub Desktop.
Dockerfile to check MarkowitzR as CRAN with atlas
#
# dockerfile to CRAN-check with r-base
#
# docker build --rm -t shabbychef/markcheck .
#
# docker run -it --rm --volume $(pwd):/srv:rw --volume /tmp:/tmp:rw shabbychef/markcheck
#
# Created: 2016.01.10
# Copyright: Steven E. Pav, 2016
# Author: Steven E. Pav
# Comments: Steven E. Pav
#####################################################
# preamble# FOLDUP
FROM rocker/r-base
MAINTAINER Steven E. Pav, shabbychef@gmail.com
# UNFOLD
ENV DOCKERFILE_REFRESHED_AT 2019.12.27
# see http://crosbymichael.com/dockerfile-best-practices.html
#RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN (apt-get clean -y ; \
apt-get update -y -qq; \
apt-get update --fix-missing );
#RUN (apt-get dist-upgrade -y ; \
#apt-get update -qq ; \
RUN (DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -q -y --no-install-recommends \
libatlas-base-dev libatlas3-base lsof \
libxml2-dev libcurl4-openssl-dev libssl-dev libgit2-dev libssh2-1-dev ; \
sync ; \
R -q -e "grep('blas', system2('lsof', c('-p', Sys.getpid()), stdout=TRUE), value = TRUE)" ; \
mkdir -p /usr/local/lib/R/site-library ; \
chmod -R 777 /usr/local/lib/R/site-library ; \
sync ; \
/usr/local/bin/install2.r testthat roxygen2 devtools matrixcalc sandwich gtools SharpeR knitr)
RUN mkdir -p /srv;
# from https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-gcc
ENV CFLAGS "-g -O2 -Wall -pedantic -mtune=native"
ENV FFLAGS "-g -O2 -mtune=native -Wall -pedantic"
ENV CXXFLAGS "-g -O2 -Wall -pedantic -mtune=native -Wno-ignored-attributes -Wno-deprecated-declarations"
ENV _R_CHECK_INSTALL_DEPENDS_ true
ENV _R_CHECK_SUGGESTS_ONLY_ false
ENV _R_CHECK_NO_RECOMMENDED_ true
ENV _R_CHECK_DOC_SIZES2_ true
ENV _R_CHECK_DEPRECATED_DEFUNCT_ true
ENV _R_CHECK_SCREEN_DEVICE_ warn
ENV _R_CHECK_REPLACING_IMPORTS_ true
ENV _R_CHECK_TOPLEVEL_FILES_ true
ENV _R_CHECK_DOT_FIRSTLIB_ true
ENV _R_CHECK_RD_LINE_WIDTHS_ true
ENV _R_CHECK_S3_METHODS_NOT_REGISTERED_ true
ENV _R_CHECK_OVERWRITE_REGISTERED_S3_METHODS_ true
ENV _R_CHECK_CODE_USAGE_WITH_ONLY_BASE_ATTACHED_ TRUE
ENV _R_CHECK_NATIVE_ROUTINE_REGISTRATION_ true
ENV _R_CHECK_FF_CALLS_ registration
ENV _R_CHECK_PRAGMAS_ true
ENV _R_CHECK_COMPILATION_FLAGS_ true
ENV _R_CHECK_R_DEPENDS_ true
ENV _R_CHECK_PACKAGES_USED_IN_TESTS_USE_SUBDIRS_ true
ENV _R_CHECK_PKG_SIZES_ false
ENV _R_CHECK_SHLIB_OPENMP_FLAGS_ true
ENV _R_CHECK_LIMIT_CORES_ true
ENV _R_CHECK_LENGTH_1_CONDITION_ package:_R_CHECK_PACKAGE_NAME_,abort,verbose
ENV _R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_ true
ENV _R_CHECK_COMPILATION_FLAGS_KNOWN_ "-Wno-deprecated-declarations -Wno-ignored-attributes -Wno-parentheses-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2"
ENV _R_CHECK_AUTOCONF_ true
ENV _R_CHECK_THINGS_IN_CHECK_DIR_ true
ENV _R_CHECK_THINGS_IN_TEMP_DIR_ true
ENV _R_CHECK_THINGS_IN_TEMP_DIR_EXCLUDE_ "^ompi"
ENV _R_CHECK_BASHISMS_ true
# oops. need these to check the package vignette
RUN (DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -q -y --no-install-recommends \
texinfo libgs9 texlive-base texlive-binaries \
libcupsimage2 libcups2 curl wget \
qpdf pandoc ghostscript \
texlive-latex-extra texlive-latex-base texlive-fonts-recommended texlive-fonts-extra ; \
sync ; \
/usr/local/bin/install2.r formatR)
#####################################################
# entry and cmd# FOLDUP
# these are the default, but remind you that you might want to use /usr/bin/R instead?
# always use array syntax:
ENTRYPOINT ["/bin/bash"]
#ENTRYPOINT ["/usr/bin/R","CMD","check","--as-cran","--output=/tmp"]
#CMD ["/srv/*.tar.gz"]
#ENTRYPOINT ["/usr/bin/R"]
#CMD ["CMD","check","--as-cran","--output=/tmp","/srv/*.tar.gz"]
# ENTRYPOINT and CMD are better together:
#CMD ["/srv/*.tar.gz"]
# UNFOLD
#for vim modeline: (do not edit)
# vim:nu:fdm=marker:fmr=FOLDUP,UNFOLD:cms=#%s:syn=Dockerfile:ft=Dockerfile:fo=croql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment