Some dockers to use Bookdown.org
Different docker images to use Bookdown.org to prepare PDF, Ebooks or HTML site from R Markdown.
- Getting Started
- Prerequisities
- Bookdown Base
- Bookdown Extended
- Bookdown User
- Authors
- Licence
- Acknowledgments
In order to run this container you'll need docker installed.
This docker image is based on r-base:3.6.0. It includes the packages needed to create PDF (LaTeX), EPUB (Pandoc), HTML sites (Gitbook) using the R bookdown package. Note that the image already contains the necessary to include Pyton 2 and Python 3 code in your book.
mainFile- Path to the main file used to create your book. Default:index.Rmd
/book- Working directory used to create the book. All your files must be in this folder.
You can simply run the following command to compile your book in the folder ./path/to/my/fodler, with main file index.Rmd into PDF, EPUB, and HTML.
docker run --rm -e "mainFile=index.Rmd" -v ./path/to/my/fodler:/book pcourbin/bookdown:baseIf you want to run a specific bookdown::render_book command, for example pdf_book you can use:
docker run --rm -e "mainFile=index.Rmd" -v ./path/to/my/fodler:/book pcourbin/bookdown:base bookdown pdf_bookit will run: bookdown::render_book('index.Rmd', 'bookdown::pdf_book')
Based on the previous image, it simply add support for:
- devtools package
- ropenscilabs/icon package
- phantomjs
- webshot package -- Which activates HTML Widgets
If you want to use docker images on Linux, it may be convenient to prepare a specific image using a uid equivalent to yours.
The file Dockerfile.user helps you.
bookdownuser- Define the name of the user you want to create in the image.uid- Define theuidof the user you want to create in the image.
Copy the file Dockerfile.user, choose $USER and $UID to correspond to your local user and run
docker build -t mybookdown:user \
--build-arg bookdownuser=$USER \
--build-arg uid=$UID \
-f Dockerfile.user .You can then simply use:
docker run --rm -e "mainFile=index.Rmd" -v ./path/to/my/fodler:/book mybookdown:userto compile your book and create the files belonging to the user $UID.
- Pierre Courbin - Initial work - PCourbin
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Thanks to Mohamad Ghassany for the discovery of Bookdown.