Skip to content

Commit

Permalink
more accurate way of grabbing the logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Rdeisenroth committed Sep 11, 2024
1 parent 06a0a60 commit 8cace24
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
FROM registry.gitlab.com/islandoftex/images/texlive:latest
FROM archlinux:latest AS build
WORKDIR /logo
# Dependencies
RUN pacman -Sy --needed --noconfirm inkscape librsvg
# Build logo
RUN curl -O https://www.tu-darmstadt.de/media/medien_stabsstelle_km/services/medien_cd/das_bild_der_tu_darmstadt.pdf \
&& inkscape --version \
&& inkscape das_bild_der_tu_darmstadt.pdf --export-filename=p1_i.svg --pages=1 \
&& sed -i 's/icc-color([^)]*)//g' p1_i.svg \
&& rsvg-convert -f pdf -o tuda_logo.pdf p1_i.svg --export-id=g23 \
&& rm das_bild_der_tu_darmstadt.pdf p1_i.svg

FROM registry.gitlab.com/islandoftex/images/texlive:latest AS run
# Dependencies
RUN apt-get update && apt-get install -y librsvg2-bin nodejs imagemagick ghostscript inkscape
RUN sed -i "s/rights=\"none\" pattern=\"PDF\"/rights=\"read|write\" pattern=\"PDF\"/" /etc/ImageMagick-6/policy.xml
RUN sed -i "s/rights=\"none\" pattern=\"PS\"/rights=\"read|write\" pattern=\"PS\"/" /etc/ImageMagick-6/policy.xml
RUN sed -i "s/rights=\"none\" pattern=\"SVG\"/rights=\"read|write\" pattern=\"SVG\"/" /etc/ImageMagick-6/policy.xml
# Install logo
COPY --from=build /logo/tuda_logo.pdf .
RUN mkdir -p "$(kpsewhich -var-value=TEXMFDIST)/tex/latex/local" \
&& curl -o tuda_logo.svg -L https://upload.wikimedia.org/wikipedia/de/2/24/TU_Darmstadt_Logo.svg\?download \
&& rsvg-convert -f pdf -o tuda_logo.pdf tuda_logo.svg \
&& mv tuda_logo.pdf "$(kpsewhich -var-value=TEXMFDIST)/tex/latex/local" \
&& texhash --verbose

# cancel the build if logo is not found
RUN kpsewhich tuda_logo.pdf

# Install AlgoTeX
WORKDIR /AlgoTeX
COPY . .
Expand Down

0 comments on commit 8cace24

Please sign in to comment.