惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Security Affairs
PCI Perspectives
PCI Perspectives
Google Online Security Blog
Google Online Security Blog
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
P
Privacy & Cybersecurity Law Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
TaoSecurity Blog
TaoSecurity Blog
V
Visual Studio Blog
博客园 - 聂微东
Scott Helme
Scott Helme
博客园 - 【当耐特】
K
Kaspersky official blog
Security Latest
Security Latest
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
MyScale Blog
MyScale Blog
Schneier on Security
Schneier on Security
WordPress大学
WordPress大学
博客园 - 叶小钗
C
Check Point Blog
V2EX - 技术
V2EX - 技术
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
T
Tor Project blog
Apple Machine Learning Research
Apple Machine Learning Research
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
雷峰网
雷峰网
博客园_首页
美团技术团队
Y
Y Combinator Blog
C
CERT Recently Published Vulnerability Notes
AWS News Blog
AWS News Blog
月光博客
月光博客
N
Netflix TechBlog - Medium
Last Week in AI
Last Week in AI
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog
C
Cybersecurity and Infrastructure Security Agency CISA

John Bokma's Hacking and Hiking

Failed to verify signature archive-contents.sig in Emacs Aquamacs 3.6 Hangs When Saving An Encrypted File PAR trouble How To Create a Bootable LibreELEC Installation using Mac OS A Docker Image for Sass Timezones in Alpine Docker Containers A Tale of Three Docker Images Debugging a Perl Docker container Perl Time::Piece Unicode Issue Giving Docker Desktop for macOS a Second Chance Flashing another TP-Link TL-WDR4300 with OpenWrt firmware Rehousing two tarantulas Getting started with the Perl version of tumblelog on Ubuntu 18.04 LTS A visit to Avonturia De Vogelkelder Flashing a TP-Link TL-WDR4300 with OpenWrt firmware Mounting a VDI File in a Different VirtualBox Guest Wireless Headless Raspberry Pi - John Bokma A Matter of Time - John Bokma Hand coding an RSS 2.0 feed in Python RFC #822 and RFC #3339 dates in Perl RFC #822 and RFC #3339 dates in Python Hand coding an RSS 2.0 feed in Perl Nav Element with no Heading Rewriting CommonMark Nodes in Perl "right" this time
Running pdflatex Using the Alpine Pandoc LaTeX Docker Image
John Bokma · 2021-06-19 · via John Bokma's Hacking and Hiking

June 20, 2021

I use a custom Perl script which uses pdflatex to generate invoices for my customers. Currently the program runs in a VirtualBox virtual machine (Ubuntu). But since I want to switch to Apple Silicon in the near future I am currently moving several programs to Docker. I was able to make the Perl program, after a few minor modifications, on macOS except for the external call to pdflatex. Since I want to reduce the number of programs I have to install directly on macOS I decided to "dockerize" pdflatex.

Because I want the Docker image to be small I started out with an Alpine image. But installing texlive-full resulted in an image of several gigabytes! After a few experiments I decided to see if I could just run pdflatex from a Pandoc Docker image I already needed for creating my resume.

$ docker run --rm --entrypoint pdflatex resume-pandoc
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded forma
t=pdflatex)
 restricted \write18 enabled.
**
! End of file on the terminal... why?

Because this image is "just" 686.6MB I decided to try to create a new image using pandoc-latex as a base:

# syntax=docker/dockerfile:1
FROM pandoc/latex:latest

ENTRYPOINT ["pdflatex"]

I build the Docker image using:

docker build -t pdflatex .

When running the container using:

docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pdflatex \
    invoice.tex

I got the following error message:

! LaTeX Error: File `sectsty.sty' not found.

Since I had seen the same error when building the image I use to create my resume I already knew the solution: install the missing package using tlmgr. So I updated the Dockerfile:

# syntax=docker/dockerfile:1
FROM pandoc/latex:latest

RUN tlmgr update --self && tlmgr install sectsty

ENTRYPOINT ["pdflatex"]

Running the newly created image resulted in another error:

! LaTeX Error: File `lastpage.sty' not found.

So I added this package as well, resulting in:

# syntax=docker/dockerfile:1
FROM pandoc/latex:latest

RUN tlmgr update --self && tlmgr install sectsty lastpage

ENTRYPOINT ["pdflatex"]

This time I got yet another error, but one that was a bit harder to fix:

! Font T1/phv/m/n/10=phvr8t at 10.0pt not loadable: Metric (TFM) file not found
.

A font was missing, but which one, and which package to install? Googling the error message gave a quick answer: helvetic. Adding this to the installation step resulted in a working image; I now could generate a PDF invoice from a TeX input file.

# syntax=docker/dockerfile:1
FROM pandoc/latex:latest

RUN tlmgr update --self && tlmgr install sectsty lastpage helvetic

ENTRYPOINT ["pdflatex"]