Host a CRAN mirror using Docker

[This article was first published on BNOSAC - Belgium Network of Open Source Analytical Consultants, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

CRAN mirrors are the backbone to everyday common R usage. They provide the R website and most of the R packages today. Currently there are about 104 official CRAN mirrors. Hosting a CRAN mirror is one step to help the R community and is explained here.



To ease that process, at BNOSAC, we have created a Docker image which sets up a CRAN mirror.
That Docker image can be found and is available for download at the following docker registry: https://registry.hub.docker.com/u/bnosac/cran-mirror

For people who don't know Docker, it is basically a tool which allows developers to containerise an application. In this case, the application is to run a CRAN mirror.
How does it work. 3 steps:

1. Install Docker on your computer or server as explained here, if you haven't done this already.
2. Pull the docker image: docker pull bnosac/cran-mirror
3. Run the CRAN mirror: docker run -p 22:22 -p 80:80 -v /home/bnosac/CRAN/:/var/www/html -d bnosac/cran-mirror

That's it! It started synching CRAN on /home/bnosac/CRAN and will synch every day at 02h30 UTC. You can now go to 0.0.0.0 in your browser or find the ip address where it is running and go to that address in your browser to see the R website (see https://registry.hub.docker.com/u/bnosac/cran-mirror for more info).

Now what can you do with it.
– have a local CRAN mirror in your company
– install.packages(“data.table”, repos = “mylocalmirror”)
– serve the community with another mirror if a closeby mirror is not readily available

To leave a comment for the author, please follow the link and comment on their blog: BNOSAC - Belgium Network of Open Source Analytical Consultants.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)