├── .gitignore ├── README.md ├── docker.Rproj └── rdevel └── Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker containers 2 | 3 | > This is my docker container. There are many like it, but this one is mine. 4 | > 5 | > My container is my best friend. It is my life. I must master it as I must 6 | > master my life. 7 | 8 | These docker containers are adaptations of the [rocker](https://github.com/rocker-org) containers, customised for my development workflow. 9 | 10 | ## To build 11 | 12 | ```sh 13 | # If on mac: 14 | docker-machine start default 15 | eval "$(docker-machine env default)" 16 | 17 | docker pull r-base # ensure we have latest base image 18 | docker build -t hadley/rdevel . 19 | ``` 20 | 21 | ## To use 22 | 23 | ```sh 24 | cd /package/dir 25 | 26 | docker run -ti --rm \ 27 | -v $(pwd):/mnt \ 28 | hadley/rdevel /bin/bash 29 | 30 | cd /mnt 31 | R 32 | install_deps(dep = T) 33 | ``` 34 | -------------------------------------------------------------------------------- /docker.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | -------------------------------------------------------------------------------- /rdevel/Dockerfile: -------------------------------------------------------------------------------- 1 | ## Adapted from rocker/r-devel-san-clang and rocker/hadleyverse 2 | FROM r-base:latest 3 | MAINTAINER "Hadley Wickham" hadley@rstudio.com 4 | 5 | ## From the Build-Depends of the Debian R package, plus subversion, and clang-3.5 6 | RUN apt-get update -qq && apt-get install -t unstable -y --no-install-recommends \ 7 | bash-completion \ 8 | bison \ 9 | clang-3.6 \ 10 | debhelper \ 11 | default-jdk \ 12 | g++ \ 13 | gcc \ 14 | gfortran \ 15 | git \ 16 | groff-base \ 17 | libblas-dev \ 18 | libbz2-dev \ 19 | libcairo2-dev \ 20 | libcurl4-openssl-dev \ 21 | libjpeg-dev \ 22 | liblapack-dev \ 23 | liblzma-dev \ 24 | libncurses5-dev \ 25 | libpango1.0-dev \ 26 | libpcre3-dev \ 27 | libpng-dev \ 28 | libreadline-dev \ 29 | libtiff5-dev \ 30 | libx11-dev \ 31 | libxt-dev \ 32 | mpack \ 33 | rsync \ 34 | subversion \ 35 | tcl8.5-dev \ 36 | texinfo \ 37 | texlive-base \ 38 | texlive-extra-utils \ 39 | texlive-fonts-recommended \ 40 | texlive-generic-recommended \ 41 | texlive-latex-base \ 42 | texlive-latex-extra \ 43 | texlive-latex-recommended \ 44 | tk8.5-dev \ 45 | valgrind \ 46 | x11proto-core-dev \ 47 | xauth \ 48 | xdg-utils \ 49 | xfonts-base \ 50 | xvfb \ 51 | zlib1g-dev 52 | 53 | ## Install inconsolata by hand 54 | RUN cd /usr/share/texlive/texmf-dist \ 55 | && wget http://mirrors.ctan.org/install/fonts/inconsolata.tds.zip \ 56 | && unzip inconsolata.tds.zip \ 57 | && rm inconsolata.tds.zip \ 58 | && echo "Map zi4.map" >> /usr/share/texlive/texmf-dist/web2c/updmap.cfg \ 59 | && mktexlsr \ 60 | && updmap-sys 61 | 62 | ## Check out R-devel 63 | RUN cd /tmp \ 64 | && svn co http://svn.r-project.org/R/trunk R-devel \ 65 | && R-devel/tools/rsync-recommended 66 | 67 | ## Build and install according to Dirk's standard recipe 68 | RUN cd /tmp/R-devel \ 69 | && R_PAPERSIZE=letter \ 70 | R_BATCHSAVE="--no-save --no-restore" \ 71 | R_BROWSER=xdg-open \ 72 | PAGER=/usr/bin/pager \ 73 | PERL=/usr/bin/perl \ 74 | R_UNZIPCMD=/usr/bin/unzip \ 75 | R_ZIPCMD=/usr/bin/zip \ 76 | R_PRINTCMD=/usr/bin/lpr \ 77 | LIBnn=lib \ 78 | AWK=/usr/bin/awk \ 79 | CFLAGS="-pipe -std=gnu99 -Wall -pedantic -g" \ 80 | CXXFLAGS="-pipe -Wall -pedantic -g" \ 81 | FFLAGS="-pipe -Wall -pedantic -g" \ 82 | FCFLAGS="-pipe -Wall -pedantic -g" \ 83 | CC="clang-3.6 -fsanitize=undefined -fno-sanitize=float-divide-by-zero,vptr,function" \ 84 | CXX="clang++-3.6 -fsanitize=undefined -fno-sanitize=float-divide-by-zero,vptr,function" \ 85 | CXX1X="clang++-3.6 -fsanitize=undefined -fno-sanitize=float-divide-by-zero,vptr,function" \ 86 | FC="gfortran" \ 87 | F77="gfortran" \ 88 | ./configure \ 89 | --enable-R-shlib \ 90 | --without-blas \ 91 | --without-lapack \ 92 | --with-readline \ 93 | --disable-openmp \ 94 | && make --jobs=4 \ 95 | && make install \ 96 | && make clean 97 | 98 | ## Set default CRAN repo to RStudio 99 | RUN echo 'options("repos"="http://cran.rstudio.com")' >> /usr/local/lib/R/etc/Rprofile.site 100 | 101 | # Useful packages ------------------------------------------------------------- 102 | 103 | # Packages needed for full R CMD check 104 | RUN apt-get update -qq && apt-get install -t unstable -y --no-install-recommends \ 105 | aspell \ 106 | aspell-en \ 107 | ghostscript \ 108 | imagemagick \ 109 | lmodern 110 | 111 | # Common dev headers 112 | RUN apt-get update -qq && apt-get install -t unstable -y --no-install-recommends \ 113 | libcairo2-dev \ 114 | libmysqlclient-dev \ 115 | libpq-dev \ 116 | libssl-dev \ 117 | libsqlite3-dev \ 118 | libxml2-dev 119 | 120 | # Install biocInstaller 121 | RUN R -q -e 'source("http://bioconductor.org/biocLite.R")' 122 | 123 | # Install devtools and all deps 124 | RUN install2.r -d TRUE --error devtools \ 125 | && rm -rf /tmp/downloaded_packages/ /tmp/*.rds 126 | 127 | # Attach devtools and testthat to match my local env 128 | RUN echo 'if (interactive()) { \ 129 | suppressMessages(require(devtools)); \ 130 | suppressMessages(require(testthat)) \ 131 | }' >> /usr/local/lib/R/etc/Rprofile.site 132 | --------------------------------------------------------------------------------