In case anyone finds this useful, here’s a very small (only 54MB compressed) docker image with working tectonic, including a primed cache that reduces the number of files tectonic needs to download when running. It works great with gitlab CI, yielding <1minute build times.
In the future, it would be great to actually link tectonic statically via musl with all its libraries since then it could be put on top of Alpine Linux to produce an even smaller image.
Yes, that’s very interesting! I’ll try if it works with Travis as well and I’ll report back (on your GitHub repo, I guess) if it does.
(and I’d add it to my repo at https://github.com/PHPirates/travis-ci-latex-pdf if you allow)
@malbarbo on GitHub just posted a set of instructions to get Tectonic to link statically on musl — here. There’s a bit of work to do to integrate this seamlessly into master, but you could probably snarf it for a Docker image pretty straightforwardly …
Making compilation work on musl looks a bit more complicated than I was hoping it would be. I might revisit it in the future when the musl support is a bit better. serde_derive not working is a big one.
After learning what Docker actually is I found out the following works for Travis: (not so clean as for GitLab, but I like that the build file is so much cleaner compared to installing everything manually!)
assuming there is a file src/main.tex
sudo: required
services:
- docker
script:
# We use the docker image from https://hub.docker.com/r/rekka/tectonic/
- docker pull rekka/tectonic
- docker run --mount src=$TRAVIS_BUILD_DIR/src,target=/usr/src/tex,type=bind rekka/tectonic tectonic main.tex
Actually the build time was indeed just under a minute on first test. I think there’s no need to cache this docker image on Travis as it seems really fast to start up. It’s cool.
Based on rekkas work I extended the docker image by adding the optional ability to run biber. It uses latest tectonic at the time of writing (0.1.10). Its a little bit bigger ~75mb (for obvious reasons ) .
You can find the image here:
I haven’t been focusing on this topic, but I am more than ready to merge PRs that help get some of the needed functionality into mainline. As I recall some patches were needed — we could use the Cargo “feature” functionality to give users the option to compile with the needed change if desired.
I’m also happy to create a repo within the tectonic-typesetting GitHub organization to host an official Dockerfile!