-
Notifications
You must be signed in to change notification settings - Fork 2.5k
added Dockerfile #655
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
added Dockerfile #655
Conversation
|
Read it now, thanks! BTW, maybe putting the Dockerfile in the scripts folder would make things simpler? |
|
@dor2727 - This is sweet. It's been on my to do list for a bit, but I'm delighted that someone's taken it on. (I'm very pro-docker...) When I have a bit of time, I'd be interested in adding a docker-compose file too, which I can do unless that's something you're already planning on... |
|
As stated in that discussion, I'm always happy to provide another way for users to get manim. However, the costs of maintaining the dockerfile will be large. As soon as this is published, users will expect it to always work. Nobody in the current dev team has capacity to commit to maintaining the docker file. If you all are volunteering to maintain it, then by all means! However, this may imply a longer involvement than you had planned 😅 |
|
Maybe you can also contribute a small action to test the Dockerfile? That would help us maintaining it a lot. Also, Thank you, for your contribution. |
Dockerfile
Outdated
| RUN python3 -m pip uninstall -y pangocairocffi cairocffi pangocffi | ||
| RUN pip3 install --no-binary :all: -U cairocffi --no-cache | ||
| RUN pip3 install --no-binary :all: -U pangocffi --no-cache | ||
| RUN pip3 install --no-binary :all: -U pangocairocffi --no-cache |
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.
I would rather suggest running --no-cache in pip3 install manimce itself and simple this can be ignored.
Great idea!
This will run an instance of this docker, execute python calling manim, render a simple scene, and echo 'yay' or 'nay', indicating if it all worked. |
What I was expecting was to Github Actions. Anyways this is also good. But again a Github Action is needed. |
|
What would the GH action involve? Installing the dockerfile and reporting if it succeeds? |
Yeah, and also runs tests there, something like an example_scene or |
|
Thank you for initiating this, I think we should definitely support docker and we have set some things in motion!
FROM python:3.7-slim
RUN apt-get update -q \
&& apt-get install --no-install-recommends -y \
ffmpeg \
gcc \
git \
libcairo2-dev \
libffi-dev \
libpango1.0-dev \
pkg-config \
wget
# setup a minimal texlive installation
COPY ./texlive-profile.txt /tmp/
ENV PATH=/usr/local/texlive/bin/x86_64-linux:$PATH
RUN wget -O /tmp/install-tl-unx.tar.gz http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \
mkdir /tmp/install-tl && \
tar -xzf /tmp/install-tl-unx.tar.gz -C /tmp/install-tl --strip-components=1 && \
/tmp/install-tl/install-tl --profile=/tmp/texlive-profile.txt \
&& tlmgr install \
amsmath babel-english cm-super doublestroke dvisvgm fundus-calligra \
jknapltx latex-bin microtype ms physics preview ragged2e relsize rsfs \
setspace standalone tipa wasy wasysym xcolor xkeyval
# clone and build manim
RUN git clone --depth 1 --branch v0.1.0 https://github.com/ManimCommunity/manim.git /opt/manim
WORKDIR /opt/manim
RUN pip install --no-cache .
# ensure ffi bindings are generated correctly
WORKDIR /usr/local/lib/python3.7/site-packages
RUN python cairocffi/ffi_build.py \
&& python pangocffi/ffi_build.py \
&& python pangocairocffi/ffi_build.py
WORKDIR /manim
RUN chmod 666 /manim
CMD [ "/bin/bash" ]The main difference is that I try to keep a more minimal texlive installation, bringing the image down to approx. 1.27GB -- but I am sure there is more potential for optimization; I am very interested in hearing your opinions @dor2727 @PhilipEnchin. The tex packages are chosen in a way that make our test suite pass in the container ( Ideally, I'd like to have images corresponding to our releases and maybe additionally the status of our |
Did you create a profile already? Because profile specifies what are things to be installed. Also, I would rather use TinyTeX as done in windows. |
Yes, I've used the following simple I have a strong preference for staying with the current texlive installation. Besides, there does not seem to be too much of a difference between what tinytex does (it selects the I will probably open a fresh PR with this setup (sorry, @dor2727 for the "hostile takeover") later today. |
|
@behackl |
Maybe this should be changed to |
"Better" is definitely not correct: we are considering sort of different use cases. I'd like to provide an image for a fixed version of manim-community so that you can use it to compile given scenes with the version installed in the container. Your setup is way more flexible.
Ah, actually no: I noticed that |
Hmm. I chose a separate, clean directory because I wanted to make mounting something into it as flexible as possible. If users were to mount their working directory to would need to call |
|
I see. Overriding the mount is a great option. And maybe we can create different docker tags. |
|
As discussed above, this is superseded by #681. |
Added a Dockerfile
The Dockerfile has 4 different docker installation options: