Running Quarto Markdown in Docker

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • quarto-docker-examples

    Quarto Examples with Docker

  • # Based on https://github.com/analythium/quarto-docker-examples/blob/main/Dockerfile.base # Version number of Quarto to download and use ARG QUARTO_VERSION="1.4.529" ARG OS_USERNAME=quarto ARG UID=1000 ARG GID=1000 FROM eddelbuettel/r2u:20.04 # librsvg2-bin is to allow SVG conversion when rendering a PDF file # (will install the rsvg-view binary) RUN set -e -x && \ apt-get update && apt-get install -y --no-install-recommends \ pandoc \ pandoc-citeproc \ curl \ gdebi-core \ librsvg2-bin \ python3.8 python3-pip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN set -e -x && \ install.r shiny jsonlite ggplot2 htmltools remotes renv knitr rmarkdown quarto # Download and install Quarto ARG QUARTO_VERSION RUN set -e -x && \ curl -o quarto-linux-amd64.deb -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \ && gdebi --non-interactive quarto-linux-amd64.deb \ && rm -f quarto-linux-amd64.deb # Should be done for the user; won't work if done for root # (quarto will say that "tinytex is not installed") ARG OS_USERNAME ARG UID ARG GID RUN set -e -x && \ groupadd -g $GID -o "${OS_USERNAME}" && \ useradd -m -u $UID -g $GID -o -s /bin/bash "${OS_USERNAME}" USER "${OS_USERNAME}" # Install tools like tinytex to allow conversion to PDF RUN set -e -x && \ quarto install tool tinytex --update-path RUN set -e -x && \ printf "\e[0;105m%s\e[0;0m\n" "Run tlmgr update" \ && ~/.TinyTeX/bin/x86_64-linux/tlmgr update --self --all && \ ~/.TinyTeX/bin/x86_64-linux/fmtutil-sys --all # See https://github.com/rstudio/tinytex/issues/426 for explanation RUN set -e -x && \ printf "\e[0;105m%s\e[0;0m\n" "Run tlmgr install for a few tinyText packages (needed for PDF conversion)" \ && ~/.TinyTeX/bin/x86_64-linux/tlmgr install fvextra footnotebackref pagecolor sourcesanspro sourcecodepro titling USER root RUN set -e -x && \ mkdir -p /input USER "${OS_USERNAME}" WORKDIR /

  • quarto-cli

    Open-source scientific and technical publishing system built on Pandoc.

  • ❯ docker build -t cavo789/quarto . [+] Building 208.2s (13/13) FINISHED docker:default => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2.08kB 0.0s => [internal] load metadata for docker.io/eddelbuettel/r2u:20.04 3.4s => CACHED [ 1/10] FROM docker.io/eddelbuettel/r2u:20.04@sha256:133b40653e0ad564d348f94ad72c753b97fb28941c072e69bb6e03c3b8d6c06e 0.0s => [ 2/10] RUN set -e -x && apt-get update && apt-get install -y --no-install-recommends pandoc pandoc-citeproc curl gdebi-core librsvg2-bin python3.8 47.6s => [ 3/10] RUN set -e -x && install.r shiny jsonlite ggplot2 htmltools remotes renv knitr rmarkdown quarto 27.2s => [ 4/10] RUN set -e -x && curl -o quarto-linux-amd64.deb -L https://github.com/quarto-dev/quarto-cli/releases/download/v1.4.529/quarto-1.4.529-linux-amd64.deb && gdebi - 12.1s => [ 5/10] RUN set -e -x && groupadd -g 1000 -o "quarto" && useradd -m -u 1000 -g 1000 -o -s /bin/bash "quarto" 0.5s => [ 6/10] RUN set -e -x && quarto install tool tinytex --update-path 23.0s => [ 7/10] RUN set -e -x && printf "\e[0;105m%s\e[0;0m\n" "Run tlmgr update" && ~/.TinyTeX/bin/x86_64-linux/tlmgr update --self --all && ~/.TinyTeX/bin/x86_64-linux/fm 77.9s => [ 8/10] RUN set -e -x && printf "\e[0;105m%s\e[0;0m\n" "Run tlmgr install for a few tinyText packages (needed for PDF conversion)" && ~/.TinyTeX/bin/x86_64-linux/tlmgr 11.7s => [ 9/10] RUN set -e -x && mkdir -p /input 0.5s => exporting to image 4.0s => => exporting layers 4.0s => => writing image sha256:fe1d20bd71a66eb574ba1f5b35c988ace57c2c30f93159caa4d5de2f8c490eb0 0.0s => => naming to docker.io/cavo789/quarto 0.0s What's Next? View summary of image vulnerabilities and recommendations → docker scout quickview

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • pandoc

    Universal markup converter

  • Until recently, I'd been using pandoc but, having taken the time to look around Quarto, it's a hell of a lot more powerful.

  • tinytex

    A lightweight, cross-platform, portable, and easy-to-maintain LaTeX distribution based on TeX Live

  • # Based on https://github.com/analythium/quarto-docker-examples/blob/main/Dockerfile.base # Version number of Quarto to download and use ARG QUARTO_VERSION="1.4.529" ARG OS_USERNAME=quarto ARG UID=1000 ARG GID=1000 FROM eddelbuettel/r2u:20.04 # librsvg2-bin is to allow SVG conversion when rendering a PDF file # (will install the rsvg-view binary) RUN set -e -x && \ apt-get update && apt-get install -y --no-install-recommends \ pandoc \ pandoc-citeproc \ curl \ gdebi-core \ librsvg2-bin \ python3.8 python3-pip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN set -e -x && \ install.r shiny jsonlite ggplot2 htmltools remotes renv knitr rmarkdown quarto # Download and install Quarto ARG QUARTO_VERSION RUN set -e -x && \ curl -o quarto-linux-amd64.deb -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \ && gdebi --non-interactive quarto-linux-amd64.deb \ && rm -f quarto-linux-amd64.deb # Should be done for the user; won't work if done for root # (quarto will say that "tinytex is not installed") ARG OS_USERNAME ARG UID ARG GID RUN set -e -x && \ groupadd -g $GID -o "${OS_USERNAME}" && \ useradd -m -u $UID -g $GID -o -s /bin/bash "${OS_USERNAME}" USER "${OS_USERNAME}" # Install tools like tinytex to allow conversion to PDF RUN set -e -x && \ quarto install tool tinytex --update-path RUN set -e -x && \ printf "\e[0;105m%s\e[0;0m\n" "Run tlmgr update" \ && ~/.TinyTeX/bin/x86_64-linux/tlmgr update --self --all && \ ~/.TinyTeX/bin/x86_64-linux/fmtutil-sys --all # See https://github.com/rstudio/tinytex/issues/426 for explanation RUN set -e -x && \ printf "\e[0;105m%s\e[0;0m\n" "Run tlmgr install for a few tinyText packages (needed for PDF conversion)" \ && ~/.TinyTeX/bin/x86_64-linux/tlmgr install fvextra footnotebackref pagecolor sourcesanspro sourcecodepro titling USER root RUN set -e -x && \ mkdir -p /input USER "${OS_USERNAME}" WORKDIR /

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts