Skip to content
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* @Paebbels

/.github/ @Paebbels
12 changes: 2 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ updates:
prefix: "[Dependabot]"
labels:
- Dependencies
reviewers:
- Paebbels
schedule:
interval: "daily" # Checks on Monday trough Friday.
interval: "weekly"

# Maintain GitHub Action runners
- package-ecosystem: "github-actions"
Expand All @@ -21,11 +19,5 @@ updates:
prefix: "[Dependabot]"
labels:
- Dependencies
assignees:
- Paebbels
- umarcor
reviewers:
- Paebbels
- umarcor
schedule:
interval: "daily" # Checks on Monday trough Friday.
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* tbd
* tbd

# Unit Tests
# Tests

* tbd
* tbd
Expand Down
156 changes: 108 additions & 48 deletions .github/workflows/Pipeline.yml

Large diffs are not rendered by default.

74 changes: 33 additions & 41 deletions Docker.buildx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,39 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================

# work around for Darwin (Mac OS)
READLINK=readlink; if [[ $(uname) == "Darwin" ]]; then READLINK=greadlink; fi
# shellcheck shell=bash

# Save working directory
WorkingDir=$(pwd)
ScriptDir="$($READLINK -f $(dirname $0))"
RootDir="$($READLINK -f $ScriptDir/..)"

ANSI_ENABLE_COLOR() {
ENABLECOLOR='-c '
ANSI_BLACK=$'\x1b[30m'
ANSI_RED=$'\x1b[31m'
ANSI_GREEN=$'\x1b[32m'
ANSI_YELLOW=$'\x1b[33m'
ANSI_BLUE=$'\x1b[34m'
ANSI_MAGENTA=$'\x1b[35m'
ANSI_CYAN=$'\x1b[36m'
ANSI_DARK_GRAY=$'\x1b[90m'
ANSI_LIGHT_GRAY=$'\x1b[37m'
ANSI_LIGHT_RED=$'\x1b[91m'
ANSI_LIGHT_GREEN=$'\x1b[92m'
ANSI_LIGHT_YELLOW=$'\x1b[93m'
ANSI_LIGHT_BLUE=$'\x1b[94m'
ANSI_LIGHT_MAGENTA=$'\x1b[95m'
ANSI_LIGHT_CYAN=$'\x1b[96m'
ANSI_WHITE=$'\x1b[97m'
ANSI_NOCOLOR=$'\x1b[0m'

# red texts
COLORED_ERROR="${ANSI_RED}[ERROR]"
COLORED_FAILED="${ANSI_RED}[FAILED]${ANSI_NOCOLOR}"
ScriptDir="$(readlink -f "$(dirname "$0")")"
RootDir="$(readlink -f "$ScriptDir/..")"

# yellow texts
COLORED_WARNING="${ANSI_YELLOW}[WARNING]"
ANSI_BLACK=$'\x1b[30m'
ANSI_RED=$'\x1b[31m'
ANSI_GREEN=$'\x1b[32m'
ANSI_YELLOW=$'\x1b[33m'
ANSI_BLUE=$'\x1b[34m'
ANSI_MAGENTA=$'\x1b[35m'
ANSI_CYAN=$'\x1b[36m'
ANSI_DARK_GRAY=$'\x1b[90m'
ANSI_LIGHT_GRAY=$'\x1b[37m'
ANSI_LIGHT_RED=$'\x1b[91m'
ANSI_LIGHT_GREEN=$'\x1b[92m'
ANSI_LIGHT_YELLOW=$'\x1b[93m'
ANSI_LIGHT_BLUE=$'\x1b[94m'
ANSI_LIGHT_MAGENTA=$'\x1b[95m'
ANSI_LIGHT_CYAN=$'\x1b[96m'
ANSI_WHITE=$'\x1b[97m'
ANSI_NOCOLOR=$'\x1b[0m'

# green texts
COLORED_PASSED="${ANSI_GREEN}[PASSED]${ANSI_NOCOLOR}"
COLORED_DONE="${ANSI_GREEN}[DONE]${ANSI_NOCOLOR}"
COLORED_SUCCESSFUL="${ANSI_GREEN}[SUCCESSFUL]${ANSI_NOCOLOR}"
}
ANSI_ENABLE_COLOR
# red texts
COLORED_ERROR="${ANSI_RED}[ERROR]"

# command line argument processing
COMMAND=2 # 0-help, 1-unknown option, 2-no arg needed
INDENT=""
VERBOSE=0; DEBUG=0
while [[ $# > 0 ]]; do
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-i|--indent)
Expand Down Expand Up @@ -125,17 +110,24 @@ Pattern_CANCELED='#[0-9]+ CANCELED'
Pattern_Tagging='#[0-9]+ naming to (.*?) done'
Pattern_MIKTEX='#[0-9]+ [0-9]+\.[0-9]+ Installing package'

while IFS='\n' read -r line; do
group=0
while IFS=$'\n' read -r line; do
if [[ "${line}" =~ $Pattern_FROM ]]; then
printf "%s\n" "${INDENT}${ANSI_MAGENTA}${line}${ANSI_NOCOLOR}"
printf "::group::%s\n" "${INDENT}${ANSI_MAGENTA}${line}${ANSI_NOCOLOR}"
group=1
elif [[ "${line}" =~ $Pattern_RUN ]]; then
printf "%s\n" "${INDENT}${ANSI_CYAN}${line}${ANSI_NOCOLOR}"
printf "::group::%s\n" "${INDENT}${ANSI_CYAN}${line}${ANSI_NOCOLOR}"
group=1
elif [[ "${line}" =~ $Pattern_COPY ]]; then
printf "%s\n" "${INDENT}${ANSI_LIGHT_CYAN}${line}${ANSI_NOCOLOR}"
elif [[ "${line}" =~ $Pattern_LABEL_ENV ]]; then
printf "%s\n" "${INDENT}${ANSI_BLUE}${line}${ANSI_NOCOLOR}"
elif [[ "${line}" =~ $Pattern_DONE ]]; then
if [[ $group -eq 1 ]]; then
printf "::endgroup::\n"
fi
printf "%s\n" "${INDENT}${ANSI_GREEN}${line}${ANSI_NOCOLOR}"
group=0
elif [[ "${line}" =~ $Pattern_ERROR ]]; then
printf "%s\n" "${INDENT}${ANSI_LIGHT_RED}${line}${ANSI_NOCOLOR}"
elif [[ "${line}" =~ $Pattern_CANCELED ]]; then
Expand Down
21 changes: 9 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# check=skip=InvalidDefaultArgInFrom;error=true

ARG IMAGE
ARG OS_VERSION
ARG PY_VERSION
ARG MIKTEX_SRC_REPO

FROM ${IMAGE}
ARG OS_VERSION
ARG PY_VERSION

# Meta information
LABEL maintainer="Patrick Lehmann <Paebbels@gmail.com>"
LABEL version="0.1"
LABEL description="MikTeX based on Debian ${OS_VERSION} and Python ${PY_VERSION}."
ARG MIKTEX_SRC_REPO

# Install Debian packages
RUN apt-get update \
Expand All @@ -20,10 +15,11 @@ RUN apt-get update \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# && apt-get dist-clean

# Install MikTeX
RUN curl -fsSL https://miktex.org/download/key | tee /usr/share/keyrings/miktex-keyring.asc > /dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/miktex-keyring.asc] https://miktex.org/download/debian ${OS_VERSION} universe" | tee /etc/apt/sources.list.d/miktex.list
RUN curl -fsSL https://miktex.org/download/key | gpg --dearmor -o /usr/share/keyrings/miktex.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/miktex.gpg] https://miktex.org/download/debian bookworm universe" | tee /etc/apt/sources.list.d/miktex.list
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ghostscript \
Expand All @@ -32,6 +28,7 @@ RUN apt-get update \
miktex \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# && apt-get dist-clean

# Install executables like lualatex into /usr/local/bin
RUN miktexsetup --shared=yes finish
Expand All @@ -49,4 +46,4 @@ ENV MIKTEX_USERCONFIG=/miktex/.miktex/texmfs/config
ENV MIKTEX_USERDATA=/miktex/.miktex/texmfs/data
ENV MIKTEX_USERINSTALL=/miktex/.miktex/texmfs/install

ENTRYPOINT /bin/bash -l
ENV MIKTEX_MAINT_GIVEUP_AFTER_DAYS=9999
11 changes: 2 additions & 9 deletions Dockerfile.Specific
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# check=skip=InvalidDefaultArgInFrom;error=true

ARG IMAGE
ARG BASE_VARIANT
ARG VARIANT

FROM ${IMAGE}
ARG BASE_VARIANT
ARG VARIANT

# Meta information
LABEL maintainer="Patrick Lehmann <Paebbels@gmail.com>"
LABEL version="0.1"
LABEL description="MikTeX with preinstalled packages for ${VARIANT} based on ${BASE_VARIANT}."

RUN --mount=type=bind,target=/context \
miktex --admin --verbose packages update-package-database \
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# MikTeX Docker Image

This repository is based on [Debian 12.x Bookworm (slim) with Python 3.13](https://hub.docker.com/_/python).
This repository is based on [Debian 12.x Bookworm (slim) with Python 3.14](https://hub.docker.com/_/python).

Docker Hub: https://hub.docker.com/r/pytooling/miktex

## Usage

Expand All @@ -18,7 +20,7 @@ Installed additional tools are:
* MikTeX
* Preinstalled packages: [Common.list](Common.list)
* Perl
* Python 3.13
* Python 3.14

## Why another MikTeX Docker Image?

Expand Down