Search code examples
rdockershinydockerfilebeamer

Installing beamer.cls when using rocker/verse and shiny


I'm new to Docker and am a user of TeX.

I'm using a Dockerfile

FROM shrektan/shiny

MAINTAINER Steven

RUN R -e "install.packages(c('shiny', 'googleAuthR', 'dplyr', 'googleAnalyticsR', 'knitr', 'rmarkdown', 'jsonlite', 'scales', 'ggplot2', 'reshape2', 'Cairo'), repos = 'https://cran.rstudio.com/')"

COPY app /srv/shiny-server/

EXPOSE 3838

to run a shiny app that allows users to run/download a beamer_presentation .pdf report.

With the Dockerfile above, the app runs well, all functionality exists, but I get an error suggesting that beamer.cls is not installed (I have included only the pertinent parts):

[...]
processing file: GA_report.Rmd
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
`geom_smooth()` using method = 'loess' and formula 'y ~ x' 
output file: GA_report.knit.md

tlmgr search --file --global '/beamer.cls'
tlmgr: Remote repository is newer than local (2017 < 2018)
Cross release updates are only supported with
update-tlmgr-latest(.sh/.exe) --update
Please see https://tug.org/texlive/upgrade.html for details.
Warning: running command ''tlmgr' search --file --global '/beamer.cls'' had 
status 1
! LaTeX Error: File `beamer.cls' not found.

! Emergency stop.
<read *> 

Warning: Error in : Failed to compile /tmp/RtmpmiHjqW/file185881070c.tex. See 
file185881070c.log for more info.
[No stack trace available]

I'm lost in trying to identify how to install the beamer.cls to this docker image.

The docker file above is made up of the image built from this Dockerfile which in turn is built from the rocker/verse Dockerfile here.

At the top of the rocker/verse Dockerfile, the author clearly states that they're using a "dummy" version of TexLive and suggests that FAQ 8 here provides more information. The FAQ link provides examples of how to install packages but not install a class, i.e., beamer.cls.

Although I'm new to Docker, I'm at a loss as to how I should go about installing the beamer.cls to my Docker image. I feel like there's something remarkably useful in the error log I provided, but can someone point out what I'm missing?


Solution

  • In principle it should be enough to add

    RUN tlmgr install beamer translator
    

    to your Dockerfile. Unfortunately this does not work directly, since the shrektan/shiny image has not been updated for several month and is still using TexLive 2017 (and R 3.4.4). The underlying rocker/verse iamge is meanwhile using TL 2018 and R 3.5.1. While it is possible to workaround the "TL to old" issue, I suggest to either ask the maintainer for a rebuild of shrektan/shiny, rebuild it yourself or include the necessary parts in your own Dockerfile based on rocker/verse.