Help needed with docker for reproducible research paper in knitr

Hi,

[sorry, edit to post, I fixed the typo in the Dockerfile. I’ll leave the post here though as a reminder of my poor editing skills. If you are curious, I’d be happy to get comments on the approach.]

I’m writing a review for a statistical journal about my work. I am using knitr, and the main complication is that I need to install a couple of packages that I have locally (rather than on CRAN). I saw Carl’s arxiv paper about using docker, so thought I’d give that a try so that a user would simply need to do:

docker run -p 49000:8787 -d sje30/eglen2015

and then connect to the rstudio instance that this runs. (The above should work, I have the package on Docker Hub and the package source is on https://github.com/sje30/eglen2015).

It mostly seems to work, except that the “eglen2015” package isn’t available in the R session; i.e. the following doesn’t work [edit: it does now[:

require(eglen2015)
vignette("eglen2015")

Sorry if this is the wrong place to ask! Otherwise, I’d appreciate any comments on this approach. (as to the content of the paper, I intend to work on that this week.)

Thanks,

Stephen

Just a note that we also tend to write the install commands using the
littler scripts rather Rscript calls, as these are more consise and avoid
cumbersome quotation use (e.g. see the hadleyverse Dockerfile). Guess we
still need a page on the rocker wiki describing these conventions. Best of
luck,

Thanks! I’ll checkout littler. It would be good to see some conventions emerging as these Dockerfiles become (hopefully) more popular.

Stephen

hmm… I see https://registry.hub.docker.com/u/rocker/hadleyverse/dockerfile/ but in there mostly calls using ‘install2.r’ – is that what you meant?

Yup. install2.r and installGithub.r are part of littler, you’ll see how we
added these to the path in rocker/r-base Dockerfile, but yeah, we should
document this properly