rstudio / tinytex

A lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live
https://yihui.org/tinytex/
Other
986 stars 116 forks source link

Tinytex in docker file #325

Closed hassanw65 closed 3 years ago

hassanw65 commented 3 years ago

Hi friends, I am trying to dockerize an R shiny application which is generating a report using a Rmarkdown file. I want download a pdf report from this application. I have installed the tiny tex distribution for that purpose and my the output of tinytex:::is_tinytex() is TRUE. However when the application start to knit the file i have an error of pdflatex not found. I am sharing my docker file any help regarding it would be much appreciated.

`

get shiny server and R from the rocker project

FROM rocker/shiny-verse:latest

system libraries Try to only install system libraries you actually need Package Manager is a good resource to help discover system deps RUN apt-get update && apt-get install -y \ libcurl4-gnutls-dev \ libssl-dev

install R packages required Change the packages list to suit your needs RUN R -e 'install.packages(c(\ "shiny", \ "shinydashboard", \ "ggplot2" \ ), \ repos="https://packagemanager.rstudio.com/cran/__linux__/focal/2021-04-23"\ )'

RUN Rscript -e "install.packages('RODBC')" RUN Rscript -e "install.packages('sqldf')" RUN Rscript -e "install.packages('dplyr')" RUN Rscript -e "install.packages('shinyWidgets')" RUN Rscript -e "install.packages('tinytex')" RUN Rscript -e "tinytex::install_tinytex()"

apt-get and system utilities RUN apt-get update && apt-get install -y \ curl apt-utils apt-transport-https debconf-utils gcc build-essential \ && rm -rf /var/lib/apt/lists/*

installing database drivers RUN sudo su RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list RUN sudo apt-get update RUN sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 optional: for unixODBC development headers RUN sudo apt-get install -y unixodbc-dev

port exposed EXPOSE 3838

copy the app directory into the image COPY ./* /srv/shiny-server/

run app CMD ["/usr/bin/shiny-server"] `

hassanw65 commented 3 years ago

any help regarding it would be much appreciated

BerriJ commented 3 years ago

Not a solution but you may upload your Dockerfile as a Github gist (like I did here). This way its easier to download and use. I may have time to look into your problem later this week but I can't promise.