Different docker images to use Bookdown.org to prepare PDF, Ebooks or HTML site from R Markdown.
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:base
If 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_book
it will run: bookdown::render_book('index.Rmd', 'bookdown::pdf_book')
Based on the previous image, it simply add support for:
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 the uid of 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:user
to compile your book and create the files belonging to the user $UID.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Content type
Image
Digest
Size
734.5 MB
Last updated
about 7 years ago
docker pull pcourbin/bookdown:extended