Skip to content
Snippets Groups Projects
Commit 9bacf69f authored by Carl Boettiger's avatar Carl Boettiger
Browse files

add missing Dockerfile

parent 2184412c
No related branches found
No related tags found
No related merge requests found
FROM debian:jessie
ARG R_VERSION
ARG BUILD_DATE
ENV BUILD_DATE ${BUILD_DATE:-2017-04-21}
ENV R_VERSION ${R_VERSION:-3.3.3}
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV TERM xterm
## dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash-completion \
ca-certificates \
file \
fonts-texgyre \
g++ \
gfortran \
gsfonts \
libbz2-1.0 \
libcurl3 \
libicu52 \
libjpeg62-turbo \
libopenblas-dev \
libpangocairo-1.0-0 \
libpcre3 \
libpng12-0 \
libtiff5 \
liblzma5 \
locales \
make \
unzip \
zip \
zlib1g \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.utf8 \
&& /usr/sbin/update-locale LANG=en_US.UTF-8 \
&& BUILDDEPS="curl \
default-jdk \
libbz2-dev \
libcairo2-dev \
libcurl4-openssl-dev \
libpango1.0-dev \
libjpeg-dev \
libicu-dev \
libpcre3-dev \
libpng-dev \
libreadline-dev \
libtiff5-dev \
liblzma-dev \
libx11-dev \
libxt-dev \
perl \
tcl8.5-dev \
tk8.5-dev \
texinfo \
texlive-extra-utils \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-latex-recommended \
x11proto-core-dev \
xauth \
xfonts-base \
xvfb \
zlib1g-dev" \
&& apt-get install -y --no-install-recommends $BUILDDEPS \
&& cd tmp/ \
## Download source code
&& curl -O https://cran.r-project.org/src/base/R-3/R-${R_VERSION}.tar.gz \
## Extract source code
&& tar -xf R-${R_VERSION}.tar.gz \
&& cd R-${R_VERSION} \
## Set compiler flags
&& R_PAPERSIZE=letter \
R_BATCHSAVE="--no-save --no-restore" \
R_BROWSER=xdg-open \
PAGER=/usr/bin/pager \
PERL=/usr/bin/perl \
R_UNZIPCMD=/usr/bin/unzip \
R_ZIPCMD=/usr/bin/zip \
R_PRINTCMD=/usr/bin/lpr \
LIBnn=lib \
AWK=/usr/bin/awk \
CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g" \
CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g" \
## Configure options
./configure --enable-R-shlib \
--enable-memory-profiling \
--with-readline \
--with-blas="-lopenblas" \
--disable-nls \
--without-recommended-packages \
## Build and install
&& make \
&& make install \
## Add a default CRAN mirror
&& echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl')" >> /usr/local/lib/R/etc/Rprofile.site \
## Add a library directory (for user-installed packages)
&& mkdir -p /usr/local/lib/R/site-library \
&& chown root:staff /usr/local/lib/R/site-library \
&& chmod g+wx /usr/local/lib/R/site-library \
## Fix library path
&& echo "R_LIBS_USER='/usr/local/lib/R/site-library'" >> /usr/local/lib/R/etc/Renviron \
&& echo "R_LIBS=\${R_LIBS-'/usr/local/lib/R/site-library:/usr/local/lib/R/library:/usr/lib/R/library'}" >> /usr/local/lib/R/etc/Renviron \
## install packages from date-locked MRAN snapshot of CRAN
&& [ -z "$BUILD_DATE" ] && BUILD_DATE=$(TZ="America/Los_Angeles" date -I) || true \
&& MRAN=https://mran.microsoft.com/snapshot/${BUILD_DATE} \
&& echo MRAN=$MRAN >> /etc/environment \
&& export MRAN=$MRAN \
&& echo "options(repos = c(CRAN='$MRAN'), download.file.method = 'libcurl')" >> /usr/local/lib/R/etc/Rprofile.site \
## Use littler installation scripts
&& Rscript -e "install.packages(c('littler', 'docopt'), repo = '$MRAN')" \
&& ln -s /usr/local/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \
&& ln -s /usr/local/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
&& ln -s /usr/local/lib/R/site-library/littler/bin/r /usr/local/bin/r \
## Clean up from R source install
&& cd / \
&& rm -rf /tmp/* \
&& apt-get remove --purge -y $BUILDDEPS \
&& apt-get autoremove -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/*
CMD ["R"]
......@@ -4,13 +4,21 @@ MAINTAINER "Carl Boettiger" cboettig@ropensci.org
## Add LaTeX, rticles and bookdown support
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
## for rJava
default-jdk \
## used by some base R plots
ghostscript \
imagemagick \
## system dependency of hadley/pkgdown
libmagick++-dev \
## used to build rJava and other packages
libbz2-dev \
libicu-dev \
liblzma-dev \
## system dependency of hunspell (devtools)
libhunspell-dev \
## R CMD Check wants qpdf to check pdf sizes, or iy throws a Warning
## system dependency of hadley/pkgdown
libmagick++-dev \
## for V8-based javascript wrappers
libv8-dev \
## R CMD Check wants qpdf to check pdf sizes, or throws a Warning
qpdf \
## for git via ssh key
ssh \
......@@ -41,10 +49,6 @@ RUN apt-get update \
## Consider including:
# - libv8-dev (Javascript V8 packages)
# - yihui/printr R package (when released to CRAN)
# - jekyll ruby-rouge (servr R package, Jekyll)
# - jags 4.2 (build from source, repo version too old and apt-tagging forces upgrade of all compiler libs)
# - libgdal-dev libproj-dev libgeos-dev (for rgdal and related geo deps)
# - libgsl0-dev (GSL math library dependencies)
# - liblzma-dev libbz2-dev libiuc-dev (dev libraries needed to build R, also used to build littler & rJava)
# - default-jdk needed for rJava
# - librdf ?
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment