New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dockerfile for use with Docker #1008
Conversation
Does this need to be separately maintained every time the Makefile.PL dependencies change? Why not use |
That sounds like a good idea, I will update to use cpanm. Although this will need maintenance when the system dependencies (e.g. libxml etc) change. |
Alright, I have updated the PR. |
Dockerfile
Outdated
zlib-dev | ||
|
||
# Install cpanmnius | ||
RUN curl -L https://cpanmin.us | perl - App::cpanminus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as in the other PR, you could add the cpanminus
dependency to the apk
section, instead of installing from curl, then it feels a bit more robust for a deployment setup.
Dockerfile
Outdated
|
||
# Installing via cpanm | ||
WORKDIR /opt/latexml | ||
RUN cpanm . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this last line is very cool to read!
One question: Is this file in the top-level LaTeXML directory? If so, is it needed to be there? |
@dginev I have updated to use cpanm from official sources, thanks for the suggestion @brucemiller The Dockerfile adds several files from the LaTeXML source code into the Docker Image. For this is it needs a directory (in Docker Terminology called a "build context") to take those files from. By convention, the build context is the directory the Dockerfile resides in. This means if the Dockerfile moved to a subdirectory, the resulting docker image can only contain files in that directory. |
For the sake of argument, would you ever have latexml dockerized on its own, without a web server or similar deployment that hosts it? Since you could always make the dockerizable aspects a plugin to the LaTeXML project. Now that I've merged the Dockerfile PR for I suspect Bruce doesn't want random files parasitizing the Perl library repository. |
This commit adds a Dockerfile, which can be used to run latexml inside a Docker Container.
I have moved the Dockerfile to the |
Dockerfile looks good to me. One extra thing we have in the Engrafo Dockerfile is installing all of Texlive. I forget what breaks now if you don't have that installed, but stuff did break for us. Texlive is enormous though, so perhaps we could add that as another version of the image. @dginev Yes, it would be useful to use standalone. For example, this one-liner would allow you to convert documents without having to install anything on your machine:
I don't have that strong feelings about it, but things in Docker-land tend to work better if the Once the Dockerfile is in, an automated build could be set up on Docker Hub so the Docker image gets build on every commit. Then, |
Thanks for chiming in @bfirsh ! Now that you added that one-liner, you've reminded me we should also update the respective manual pages if we decide to include the docker file -- after all the latexml users should have examples and guidance. And the PR looks twice as legitimate a need now cc @brucemiller |
As to texlive, I think I remember @tkw1536 was telling me the other day that he wanted to add that as a flag to the command and make it configurable? Definitely helpful to have the choice. |
This commit allows to specifiy a build argument `WITH_TEXLIVE` to include TeXLive when building the Dockerfile. By default, this is set to false.
I have updated the Dockerfile to allow to optionally include TeXLive using build arguments. This works as following. By default, no TeXLive is included. One would build the Docker Image like so: docker build -t latexml -f release/Dockerfile . To include TeXLive, the docker build -t latexml --build-arg WITH_TEXLIVE=yes -f release/Dockerfile . In my tests, the docker image without TeXLIve is 215 MB in size, whereas the image with TeXLive is 2.81 GB in size. Sadly DockerHub (for automated builds that @bfirsh suggested above) does not seem to support build arguments, so it is non-trivial to automate builds for both variants of the image. |
This commit adds a Dockerfile to LaTeXML to be able to use latexml easily within a Docker container.