Skip to content

Commit

Permalink
[DOCKER] Latex: switch to debian base (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-lancini authored Dec 1, 2022
1 parent a033ddd commit 115f251
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 16 deletions.
38 changes: 36 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,59 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-json
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
- id: end-of-file-fixer
- id: no-commit-to-branch
args: ['--branch', 'main']
stages:
- 'commit'
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier/
rev: v3.0.0-alpha.4
hooks:
- id: prettier

- repo: https://github.com/crate-ci/typos
rev: v1.12.14
hooks:
- id: typos
args: ['--write-changes', '--config', '.typos.toml']

- repo: https://github.com/rhysd/actionlint
rev: v1.6.22
hooks:
- id: actionlint

# ============================================================================
# TERRAFORM
# ============================================================================
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.76.0
hooks:
- id: terraform_fmt

# ============================================================================
# DOCKER
# ============================================================================
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v2.1.1
hooks:
- id: docker-compose-check

- repo: https://github.com/hadolint/hadolint
rev: v2.12.1-beta
hooks:
- id: hadolint
37 changes: 23 additions & 14 deletions docker/latex/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
FROM alpine:3.16.0
FROM debian:11.5

LABEL org.opencontainers.image.source = "https://github.com/marco-lancini/utils"

# Install packages
#  OPTIONAL packages:
# texmf-dist-formatsextra \
# texmf-dist-pictures \
# texmf-dist-science \
RUN apk update && \
apk add --no-cache \
texlive \
texlive-xetex \
texmf-dist \
texmf-dist-latexextra \
&& rm -rf /var/cache/apk/*
RUN apt update && \
apt install -y \
wget \
texlive \
texlive-xetex \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-extra \
&& rm -rf /var/lib/apt/lists/*

RUN addgroup --gid 11111 -S app
RUN adduser -s /bin/false -u 11111 -G app -S app
# Install the roboto font
WORKDIR /root
RUN wget http://mirror.ctan.org/install/fonts/roboto.tds.zip

WORKDIR /root/texmf
RUN unzip /root/roboto.tds.zip && \
texhash && \
updmap-sys --enable Map=roboto.map

# Create low-privilege user
RUN addgroup --gid 11111 app
RUN adduser --shell /bin/false --uid 11111 --gid 11111 --disabled-login app

# Define workdir
WORKDIR /src
RUN chown -R app:app /src
USER app

0 comments on commit 115f251

Please sign in to comment.