I am trying to create a Docker image with texlive which is not >4G heavy like docker.io/texlive/texlive. Installing e.g. from Debian sources won't build, because once you want to add certain packages (e.g. tlmgr install cleveref) right now it only says:
tlmgr: Local TeX Live (2020) is older than remote repository (2021).
because CTAN mirrors have updated to 2021, but Debian has not.
So I am trying to install the recommended way using install-tl-unx.tar.gz, but this also keeps failing because no CTAN mirror can be reached. Here is a minimum example of the Dockerfile:
FROM alpine:latest
RUN apk add perl
RUN wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz; \
tar -xzf install-tl-unx.tar.gz;
RUN cd install-tl-* ; \
perl ./install-tl
It fails stating that it cannot contact mirror.ctan.org, even though a second before it downloaded the installer from the very same site:
query_ctan_mirror: Programs not set up, trying wget
Loading http://www.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb
cannot contact mirror.ctan.org, returning a backbone server!
./install-tl: TLPDB::from_file could not initialize from: http://www.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb
./install-tl: Maybe the repository setting should be changed.
./install-tl: More info: https://tug.org/texlive/acquire.html
We can even force using that server and also force HTTPS with the --location argument:
RUN cd install-tl-*; \
perl ./install-tl --location https://mirror.ctan.org/systems/texlive/tlnet
Still the same, the server cannot be reached. I also tried other mirrors, which I tested to be available in my browser, none worked.
So I wonder what I need to do to have that installation run reliably, so that this can run inside a CI job.
perl ./install.shrather than justsource ./install.sh? – Joseph Wright Apr 29 '21 at 15:08perlin the docs – mcnesium Apr 29 '21 at 15:09texlive.tlpdbfails, see https://pastebin.com/a3viMFUX – mcnesium Apr 29 '21 at 15:22cannot contact mirror.ctan.org, returning a backbone server!, is the docker build process behind some sort of proxy or similar. Note that when playing with this you can easily make your own copy oftlnetvia the mirror nodes that supportsrsyncand then ask the installer to explicit use that until you know docker can build this thing. – daleif Apr 29 '21 at 15:37curlthe URL that is listed in your question, I get an HTTP 302 redirect, but the link included in the redirect message points to an empty file when I tried to fetch it. – Willie Wong Apr 29 '21 at 16:30query_ctan_mirror()failed, and soinstall_tldefaults to using the backbone. Therefore it should be printed before any attempt to load atlpdbfile. In any case, have you tried specifying a specific repository? Use for example--location https://ctan.math.washington.edu/tex-archive/systems/texlive/tlnet/? I am wondering if something in your system is chocking on the mirror redirects. – Willie Wong Apr 29 '21 at 17:25cleverefcan be found intexlive-latex-extra(52MB). If you know which packages you want for your Docker image then you can probably find a suitable combination of Debian packages that is less than 4GB combined. – Marijn Apr 29 '21 at 18:27texlive/texliveimage but maybe the Dockerfile might help nevertheless. After all, the build succeeds and the basic instructions are very similar to yours. – TeXnician Apr 30 '21 at 05:53curl --head --silent --location --output /dev/null --write-out %{url_effective} http://www.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb– mcnesium Apr 30 '21 at 14:52--location …with other mirrors, as I stated above. None worked, unfortunately – mcnesium Apr 30 '21 at 14:52tlmgrafterwards will fail with the "older than remote repository" error that I quoted above. – mcnesium Apr 30 '21 at 14:53pandoc/lateximage plus the tlmgr packages I need. This results in a 730MB image which is probably as low as I can go. It still installs more than I actually need, but at least not gigabytes of it. – mcnesium Apr 30 '21 at 14:53tlmgr, the solution I proposed is to not usetlmgrfor anything, but instead install a few smalltexlive-xyzpackages from Debian, which would leave you with a 2020 TeX Live but that is fine for most purposes and is much less than 4GB - and most importantly it is very easy to install in Docker. In this scenario, if you want an extra package, you locate the appropriate Debian package that contains that LaTeX package, and you install that withaptor similar. – Marijn Apr 30 '21 at 15:12