Skip to content
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

Better Dockerfile #7

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .github/workflows/github_action_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -38,7 +30,7 @@ jobs:
- name: Upload PDF as Artifact
uses: actions/upload-artifact@v4
with:
name: compiled-pdf
name: compiled-pdf-${{ github.ref_slug }}
path: output.pdf

- name: Upload binaries to release
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,7 @@ TSWLatexianTemp*
*.lpz

build/

*.pdf

*.eps
24 changes: 11 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

# Use an official Ubuntu base image
FROM ubuntu:22.04

# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive

# Install LaTeX packages
# Install LaTeX packages and other dependencies in one RUN command to minimize layers
RUN apt-get update && apt-get install -y \
make \
pandoc \
Expand All @@ -17,21 +16,20 @@ RUN apt-get update && apt-get install -y \
texlive-luatex \
texlive-pstricks \
texlive-xetex \
wget

RUN wget --output-document=/usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 && \
chmod +x /usr/local/bin/yq && \
yq --version

RUN apt-get update && apt-get install -y \
fonts-roboto-slab

RUN apt-get update && apt-get install -y \
wget \
fonts-roboto-slab \
ghostscript \
python3 \
python3-pip
python3-pip \
&& wget --output-document=/usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
&& chmod +x /usr/local/bin/yq \
&& yq --version \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# bind mount requirements.txt and install python dependencies
# Note: This will only work during a Docker build if you use BuildKit, otherwise, you need to copy the requirements.txt file
# and run pip install as a separate step during container runtime.
RUN --mount=type=bind,target=/latex_content pip3 install -r /latex_content/requirements.txt

# Set working directory
Expand Down