mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-19 19:46:49 +08:00
chore(ci): create Docker image (#355)
* chore(ci): create Docker image * fix(ci): run only if tag is pushed * chore(docs): add changelog entry
This commit is contained in:
55
docker/Dockerfile
Normal file
55
docker/Dockerfile
Normal file
@ -0,0 +1,55 @@
|
||||
# Mostly a copy from https://github.com/ManimCommunity/manim/blob/68bd79093e1ebc1ed9f8051942ffe6e72a9e66a7/docker/Dockerfile
|
||||
FROM python:3.11-slim
|
||||
|
||||
RUN apt-get update -qq \
|
||||
&& apt-get install --no-install-recommends -y \
|
||||
ffmpeg \
|
||||
build-essential \
|
||||
gcc \
|
||||
cmake \
|
||||
libcairo2-dev \
|
||||
libffi-dev \
|
||||
libpango1.0-dev \
|
||||
freeglut3-dev \
|
||||
pkg-config \
|
||||
make \
|
||||
wget \
|
||||
ghostscript
|
||||
|
||||
# setup a minimal texlive installation
|
||||
COPY docker/texlive-profile.txt /tmp/
|
||||
ENV PATH=/usr/local/texlive/bin/armhf-linux:/usr/local/texlive/bin/aarch64-linux:/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 cbfonts-fd cm-super ctex doublestroke dvisvgm everysel \
|
||||
fontspec frcursive fundus-calligra gnu-freefont jknapltx latex-bin \
|
||||
mathastext microtype ms physics preview ragged2e relsize rsfs \
|
||||
setspace standalone tipa wasy wasysym xcolor xetex xkeyval
|
||||
|
||||
# clone and build manim-slides
|
||||
COPY . /opt/manim-slides
|
||||
WORKDIR /opt/manim-slides
|
||||
RUN pip install --no-cache manim[jupyterlab] .[sphinx-directive]
|
||||
|
||||
ARG NB_USER=manimslidesuser
|
||||
ARG NB_UID=1000
|
||||
ENV USER ${NB_USER}
|
||||
ENV NB_UID ${NB_UID}
|
||||
ENV HOME /manim-slides
|
||||
|
||||
RUN adduser --disabled-password \
|
||||
--gecos "Default user" \
|
||||
--uid ${NB_UID} \
|
||||
${NB_USER}
|
||||
|
||||
# create working directory for user to mount local directory into
|
||||
WORKDIR ${HOME}
|
||||
USER root
|
||||
RUN chown -R ${NB_USER}:${NB_USER} ${HOME}
|
||||
RUN chmod 777 ${HOME}
|
||||
USER ${NB_USER}
|
||||
|
||||
CMD [ "/bin/bash" ]
|
15
docker/README.md
Normal file
15
docker/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Docker Image
|
||||
|
||||
Manim Slides Docker image, highly inspired from the Manim Community Docker image.
|
||||
|
||||
Building the image can be done with:
|
||||
|
||||
```bash
|
||||
docker build -t manimcommunity/manim:TAG -f docker/Dockerfile .
|
||||
```
|
||||
|
||||
from the root directory of the repository.
|
||||
|
||||
> [!WARNING]
|
||||
> If you run the command above from another place,
|
||||
> Docker will not be able to find expected files.
|
10
docker/texlive-profile.txt
Normal file
10
docker/texlive-profile.txt
Normal file
@ -0,0 +1,10 @@
|
||||
selected_scheme scheme-minimal
|
||||
TEXDIR /usr/local/texlive
|
||||
TEXMFCONFIG ~/.texlive/texmf-config
|
||||
TEXMFHOME ~/texmf
|
||||
TEXMFLOCAL /usr/local/texlive/texmf-local
|
||||
TEXMFSYSCONFIG /usr/local/texlive/texmf-config
|
||||
TEXMFSYSVAR /usr/local/texlive/texmf-var
|
||||
TEXMFVAR ~/.texlive/texmf-var
|
||||
option_doc 0
|
||||
option_src 0
|
Reference in New Issue
Block a user