YAMLResume

Docker

Besides the CLI package, YAMLResume also provides a docker image for easy onboarding.

As we've documented, you can run yamlresume docker container with the following command:

docker run --rm -v $(pwd):/app -w /app yamlresume/yamlresume <command>

However if you are interested, you can customize the Docker image to suit your needs.

Build Docker Image

YAMLResume's Docker image is defined and generated in two phases:

Dockerfile.base

Dockerfile.base contains the base environment for running YAMLResume, including all necessary dependencies like XeTeX from TeX Live and Google Noto Font.

This is a base image mostly used for accelerating the build process on Github Actions. Instead of installing the full TeX Live distribution via apt (which takes about 30 minutes), it installs TinyTeX and uses tlmgr to install only the 37 LaTeX packages the built-in templates actually need, then prunes everything XeTeX never reads: unused engines, pTeX-era CJK font trees, and build-time tooling. It also ships just the four Noto CJK SC weights the templates reference instead of the full fonts-noto-cjk packages. These changes cut the base image from 894 MB to 807 MB — check the slim docker image blog post if you are curious about the details.

Generally you don't need to build this image yourself, you can just reuse the published image on dockerhub.

Dockerfile

Dockerfile defined how yamlresume/yamlresume image is built, it is very simple and straightforward, just installed yamlresume from npmjs by npm install -g yamlresume@latest and create necessary users and groups as per Docker's security best practices.

Building the yamlresume image locally is a trivial task. You just need to run

docker build -t yamlresume/yamlresume .

You may need to take a look at docker multi-platform build if you, for example, run into issues building docker images for different architectures.

I wrote some tips on X, you can take a look if you are interested.

Edit on GitHub

Last updated on

On this page