sjmgarnier / viridis

Colorblind-Friendly Color Maps for R
http://sjmgarnier.github.io/viridis
Other
289 stars 38 forks source link

Add Dockerfile for building/testing #30

Closed noamross closed 8 years ago

noamross commented 8 years ago

The added Dockerfile contains everything needed to build and test on the R-development branch, based on the rocker/r-devel image but including spatial libraries and needed packages.

This should close #29.

noamross commented 8 years ago

The following works when running in this image with viridis as the project directory. From within the project directory, do this:

docker built -t viridis .  # Build from the local Dockerfile, call the image "viridis". 
docker run -i -t -v "$(pwd)":/viridis -w /viridis viridis bash #Run the image interactively, mapping the current directory
cd ..  # Go up a directory
R CMD build viridis
R CMD Rdpdf viridis
R CMD check viridis_0.3.3.tar.gz

No notes or warnings from R CMD check. I suspect there's something to do with paths running devtools::check() via RStudio, but I haven't been able to nail it down. But the PDF manual works and looks good!

I think you can submit the package as-is, because here we're simulating the actual CRAN build environment than by using devtools/RStudio/OSX. This Dockerfile is a nice-to-have for the future.

sjmgarnier commented 8 years ago

Thanks @noamross. I will prepare the package for submission as soon as I can. I also nee to make sure I have made the same changes to the lite version.

noamross commented 8 years ago

I just ran the same test there and it worked. Should I add the Dockerfile? I actually get success on OSX when I run devtools::check() from the R console, and not from the RStudio button, so the Docker is a bit superfluous, but it's nice for checking against the development version.

sjmgarnier commented 8 years ago

@noamross Yes, add the Dockerfile. It cannot hurt to have it anyway.