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

推荐订阅源

C
Cisco Blogs
Schneier on Security
Schneier on Security
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tenable Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
Security Latest
Security Latest
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
Scott Helme
Scott Helme
Webroot Blog
Webroot Blog
Project Zero
Project Zero
Google Online Security Blog
Google Online Security Blog
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
Hacker News: Ask HN
Hacker News: Ask HN
PCI Perspectives
PCI Perspectives
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
N
News | PayPal Newsroom
Help Net Security
Help Net Security
The Hacker News
The Hacker News
H
Heimdal Security Blog
O
OpenAI News
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 叶小钗
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
I
Intezer
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security Affairs
P
Proofpoint News Feed
S
Secure Thoughts
腾讯CDC
Google DeepMind News
Google DeepMind News
量子位
罗磊的独立博客

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 Running pdflatex Using the Alpine Pandoc LaTeX Docker Image 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 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
Giving Docker Desktop for macOS a Second Chance
John Bokma · 2021-06-03 · via John Bokma's Hacking and Hiking

June 2, 2021

In the evening I installed Docker Desktop on my Mac mini late 2014. Years ago I had looked into Docker for Mac and back then it was not that useful to me, so I stayed with Oracle's VirtualBox. Today I wanted to give docker a second chance and check if I could use it to run Pandoc inside a container to generate a PDF version of my résumé and curriculum vitae.

Installing Docker Desktop for Mac

After I had downloaded the installer, about 600MB, I opened it and macOS verified the downloaded file which took quite some time.

Docker desktop drag and drop install
Docker desktop drag and drop install.

Next, I dragged the Docker icon and dropped it on the Applications folder shown in the installer dialog. The installation process took a few minutes.

Next, I started the Docker.app by double clicking it in the Applications folder. Another, faster, verification step took place and a dialog popped up asking me if I was sure I wanted to open Docker. I clicked the "Open" button and another warning popped up:

Docker Desktop needs privileged access to install its networking components and links to the Docker apps.

You will be asked for your password.

After I had confirmed this action with my password Docker opened a large window with the message "Docker Engine starting...". This also took quite some time.

Testing Docker for Desktop with resume-pandoc

Back in 2016 I made a résumé LaTeX template for the universal document converter Pandoc. To test Docker on my Mac mini I considered this a good candidate especially as there is already an official Docker image: pandoc/latex.

To get started, I first cloned my own GitHub repository as follows:

git clone https://github.com/john-bokma/resume-pandoc.git

This creates a new directory resume-pandoc. Next, I changed into this directory:

cd resume-pandoc

Next, I ran the following Docker command:

docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g`  \
    pandoc/latex perl-programmer-john-bokma-resume.md \
                 -f markdown+yaml_metadata_block \
                 --template templates/jb2resume.latex \
                 -o perl-programmer-john-bokma-resume.pdf

Because this was the first time I ran this command Docker downloaded the latest image for pandoc/latex. After the downloading had finished I got the following error message:

Error producing PDF.
! LaTeX Error: File `enumitem.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.14 \usepackage

This means that the package enumitem, which my resume requires, is missing from the official pandoc/latex image. So I created my own Dockerfile with the following contents:

# syntax=docker/dockerfile:1
FROM pandoc/latex:latest
RUN tlmgr update --self && tlmgr install enumitem

This uses the TeX live manager to install the enumitem package. Next, I ran:

docker build --tag=resume-pandoc .

To create my own Docker image with the missing package included.

Next, I ran the following Docker command. Note that I use the name of the newly created Docker image which includes the enumitem package:

docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` \
    resume-pandoc perl-programmer-john-bokma-resume.md \
                  -f markdown+yaml_metadata_block \
                  --template templates/jb2resume.latex \
                  -o perl-programmer-john-bokma-resume.pdf

This resulted in another error: the sectsty package could not be found:

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

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.58 \sectionfont

So I updated the Dockerfile to include this package as well:

# syntax=docker/dockerfile:1
FROM pandoc/latex:latest
RUN tlmgr update --self && tlmgr install enumitem sectsty

And rebuild the Docker image using:

docker build --tag=resume-pandoc .

After this, I ran the Docker run command again:

docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` \
    resume-pandoc perl-programmer-john-bokma-resume.md \
                  -f markdown+yaml_metadata_block \
                  --template templates/jb2resume.latex \
                  -o perl-programmer-john-bokma-resume.pdf

And this time a PDF version of my résumé was created inside the resume-pandoc directory.

Although this was just a small test it has convinced me to put Docker to actual use on my Mac.

Related