8

I planning to use LaTeX in a docker environment for server-based generation of PDF-reports.

In the current test system environment I am playing around using this docker container from the hub which seems to work quite well.

However, as stated the container's dockerfile the container is based on Ubuntu which leads to a relative huge container size compared to the functionality I really need due to Ubuntu's system overhead.

I think I can get rid of that unneeded system overhead as Docker Inc. did by using Alpine Linux instead of Ubuntu.

Unfortunately I cannot find any LaTeX packages in Alpine's repositories. I installed a non-docker based Alpine system as a virtual machine and tried:

apk update
apk search -v --description 'latex' 

which did not found any related packages. In addition to that I was not able to find any further information about LaTeX packages using Google.

So, is there something like an official repository providing LaTeX for Alpine or is there a way for using e.g. the Debian/Ubuntu packages in Alpine?


Update:

There is a texlive package available. However as discussed here that seems to be broken somehow...


Update due to broken link:

The link provided above is broken. The new link to the packages overview is here.

albert
  • 8,027
  • 10
  • 48
  • 84
  • I would love to have a smaller base image based on alpine...but I can't say I would know where to start to test whether it is functioning properly. LaTeX is awesome. Installing its dependencies is not so awesome... – bean5 Jun 18 '16 at 18:24
  • Your link to the texlive package is broken. – bean5 Jun 18 '16 at 18:26
  • The more I use LaTeX, the more I am surprised at how long it takes to build my own image. I don't fully know how the Ubuntu repositories work and how dependencies work...when I install textlive-full+texlive-math-extra, it seems like my image gets a lot larger. I mean by gigabytes. Given that the ubuntu base image is much smaller, and that a desktop install of ubuntu is gigabytes, it seems like somewhere LaTeX depends on a huge amount of packages. I can't fathom how something could depend on such a huge volume of packages without either never using some of them, or becoming unmanageable. – bean5 Jun 18 '16 at 18:28
  • I probably didn't need textlive-full. That probably has a lot of contrib stuff. I guess if the alpine image started with getting the texlive-latex-base package working, things would be a hop, skip, and a jump from there. – bean5 Jun 18 '16 at 18:41

1 Answers1

9

Actually, the Ubuntu 14.04 container is only 65 MB. See https://hub.docker.com/r/library/ubuntu/tags/14.04/

So what makes the container large is texlive. You would need to find a way to install only the parts of texlive you really need for your project.

Alpine provides now texlive in the Edge branch. See https://pkgs.alpinelinux.org/packages?name=texlive*

You can read at https://wiki.alpinelinux.org/wiki/Edge how to enable support for the Edge branch.

There is also one example of a Docker container based on Alpine linux, which might be worth to check out: https://github.com/mattmahn/docker-latex

Ward Muylaert
  • 545
  • 4
  • 27
tmaier
  • 953
  • 9
  • 17