diff --git a/templates/src/latex/Dockerfile b/templates/src/latex/Dockerfile index f04eb83..0ded311 100644 --- a/templates/src/latex/Dockerfile +++ b/templates/src/latex/Dockerfile @@ -99,13 +99,6 @@ ENV DEBIAN_FRONTEND="noninteractive" ARG TEXDIR ARG TEXUSERDIR -LABEL org.opencontainers.image.authors "John Muchovej " -LABEL org.opencontainers.image.url "https://github.com/jmuchovej/devcontainers" -LABEL org.opencontainers.image.documentation \ - "https://github.com/jmuchovej/devcontainers/blob/main/src/templates/latex/README.md" -LABEL org.opencontainers.image.source \ - "https://github.com/jmuchovej/containers/tree/main/src/templates/latex" - #! Set environment variables ENV LANG="en_US.UTF-8" ENV LANGUAGE="en_US.UTF-8" diff --git a/templates/src/latex/devcontainer-template.json b/templates/src/latex/devcontainer-template.json index bd158ba..0fbd667 100644 --- a/templates/src/latex/devcontainer-template.json +++ b/templates/src/latex/devcontainer-template.json @@ -5,7 +5,7 @@ "description": "LaTeX Devcontainer with customizable LaTeX engine.", "documentationURL": "https://github.com/jmuchovej/devcontainers/tree/main/templates/src/latex/", "publisher": "John Muchovej ", - "licenseURL": "https://github.com/jmuchovej/containers/tree/main/LICENSE", + "licenseURL": "https://github.com/jmuchovej/devcontainers/tree/main/LICENSE", "platforms": ["Any"], "keywords": ["latex", "xelatex", "lualatex", "pdftex"], "options": { diff --git a/templates/src/latex/docker-bake.hcl b/templates/src/latex/docker-bake.hcl index 9dc68ac..139aa20 100644 --- a/templates/src/latex/docker-bake.hcl +++ b/templates/src/latex/docker-bake.hcl @@ -1,66 +1,51 @@ //! How to edit this file: -// 1. In the `default` group (below), you should append `texlive-????` where `????` is -// the year you're adding. -// 2. You should copy the most recent `target` block and take care to update: -// 1. `TEXLIVE_VERSION` -// Cmd+F "Current release": https://tug.org/texlive/ -// 2. `CHKTEX_VERSION` -// Releases here: http://download.savannah.gnu.org/releases/chktex -// 3. `VARIANT` <-- this is based on when the Ubuntu's LTS release schedule -// LTS __standard__ support schedule: https://ubuntu.com/about/release-cycle#ubuntu +//! In the `matrix` component of the `target: "latex"` block, prepend a new object +//! with keys `{ texlive = ????, chktex = ????, variant = ????}`, then update the +//! `variable "LATEST"` block to a default value matching this new entry! +// What the variables in the object you're adding refer to! +// 1. `texlive` <-- this is the year of TeXLive we're building! +// Cmd+F "Current release": https://tug.org/texlive/ +// 2. `chktex` <-- this is the version of `chktex` to install +// Releases here: http://download.savannah.gnu.org/releases/chktex +// 3. `variant` <-- this is based on when the Ubuntu's LTS release schedule +// LTS __standard__ support schedule: https://ubuntu.com/about/release-cycle#ubuntu -group "default" { - targets = ["texlive2022", "texlive2023", "texlive2024"] -} - -target "shared" { - context = "./" - dockerfile = "Dockerfile" - platforms = [ "linux/amd64", "linux/arm64", ] +variable "LATEST" { + type = string + default = "2024" } -target "texlive2024" { - inherits = ["shared"] - args = { - TEXLIVE_VERSION = "2024" - CHKTEX_VERSION = "1.7.9" - VARIANT = "noble" - } - labels = { - "org.opencontainers.image.title" = "LaTeX DevContainer with TeXLive 2024" - } - tags = [ - "ghcr.io/jmuchovej/latex-devcontainer:2024", - "ghcr.io/jmuchovej/latex-devcontainer:latest", - ] +group "default" { + targets = [ "latex" ] } -target "texlive2023" { - inherits = ["shared"] - args = { - TEXLIVE_VERSION = "2023" - CHKTEX_VERSION = "1.7.8" - VARIANT = "jammy" - } - labels = { - "org.opencontainers.image.title" = "LaTeX DevContainer with TeXLive 2023" - } - tags = [ - "ghcr.io/jmuchovej/latex-devcontainer:2023", - ] -} +repo = "https://github.com/jmuchovej/devcontainers" +template = "${repo}/tree/main/src/templates/latex" +image = "ghcr.io/jmuchovej/devcontainers/latex" -target "texlive2022" { - inherits = ["shared"] - args = { - TEXLIVE_VERSION = "2022" - CHKTEX_VERSION = "1.7.6" - VARIANT = "jammy" - } - labels = { - "org.opencontainers.image.title" = "LaTeX DevContainer with TeXLive 2022" - } - tags = [ - "ghcr.io/jmuchovej/latex-devcontainer:2022", +target "latex" { + matrix = { + item = [ + {texlive = "2024", chktex = "1.7.9", variant = "noble", }, + {texlive = "2023", chktex = "1.7.8", variant = "jammy", }, + {texlive = "2022", chktex = "1.7.6", variant = "jammy", }, ] + } + name = "latex-v${replace(item.texlive, ".", "-")}" + context = "./" + dockerfile = "Dockerfile" + platforms = [ "linux/amd64", "linux/arm64", ] + args = { + VARIANT = item.variant + CHKTEX_VERSION = "${item.chktex}" + TEXLIVE_VERSION = "${item.texlive}" + } + labels = { + "org.opencontainers.image.source" = repo + "org.opencontainers.image.authors" = "John Muchovej " + "org.opencontainers.image.url" = "${template}" + "org.opencontainers.image.documentation" = "${template}/README.md" + "org.opencontainers.image.title" = "LaTeX Devcontainer with TexLive ${item.texlive}" + } + tags = [ "${image}:${item.texlive}", LATEST == item.texlive ? "${image}:latest" : "", ] } diff --git a/templates/src/typst/Dockerfile b/templates/src/typst/Dockerfile index 2fa572a..059d6d6 100644 --- a/templates/src/typst/Dockerfile +++ b/templates/src/typst/Dockerfile @@ -30,13 +30,6 @@ RUN cargo build --release #region Output Stage #################################################################### FROM mcr.microsoft.com/devcontainers/rust:${VARIANT} as output -LABEL org.opencontainers.image.authors "John Muchovej " -LABEL org.opencontainers.image.url "https://github.com/jmuchovej/devcontainers/tree/main/src/templates/typst" -LABEL org.opencontainers.image.documentation \ - "https://github.com/jmuchovej/devcontainers/blob/main/src/templates/typst/README.md" -LABEL org.opencontainers.image.source \ - "https://github.com/jmuchovej/devcontainers" - COPY --from=typst-builder /typst/target/release/typst /usr/local/bin/typst # TODO add support for Typestyle (directly within the container)! # COPY --from=typstyle-builder /typst/target/release/typstyle /usr/local/bin/typstyle diff --git a/templates/src/typst/docker-bake.hcl b/templates/src/typst/docker-bake.hcl index e9b9b80..144fc80 100644 --- a/templates/src/typst/docker-bake.hcl +++ b/templates/src/typst/docker-bake.hcl @@ -1,52 +1,54 @@ //! How to edit this file: -// 1. In the `default` group (below), you should append `texlive-????` where `????` is -// the year you're adding. -// 2. You should copy the most recent `target` block and take care to update: -// 1. `TYPST_VERSION` -// https://github.com/typst/typst/releases -// 2. `VARIANT` <-- Use the latest Debian, but prefix with Rust major version! -// Cmd+F "rust-version" in https://github.com/typst/typst/blob/main/Cargo.toml +//! In the `matrix` component of the `target: "typst"` block, prepend a new object +//! with keys `{ typst = ????, typstyle = ????, variant = ????}`, then update the +//! `variable "LATEST"` block to a default value matching this new entry! +// What the variables in the object you're adding refer to! +// 1. `typst` <-- this is the year of TeXLive we're building! +// Releases here: https://github.com/typst/typst/releases/latest +// 2. `typstyle` <-- this is the version of `typstyle` to build +// Releases here: http://github.com/Enter-tainer/typstyle/releases/latest +// 3. `variant` <-- this is based on what `mcr.microsoft.com` publishes as the latest +// variant of Rust! see more: +// https://mcr.microsoft.com/en-us/product/devcontainers/rust/about#using_this_image +//* NOTE: this should be the latest Debian **prefixed with the _major version_** +//* found in typst's `Cargo.toml`! +//* Cmd+F "rust-version" in https://github.com/typst/typst/blob/main/Cargo.toml -group "default" { - targets = [ - "typst-v0-11-1", - "typst-v0-11-0", - ] +variable "LATEST" { + type = string + default = "0.11.1" } -target "shared" { - context = "./" - dockerfile = "Dockerfile" - platforms = [ "linux/amd64", "linux/arm64", ] +group "default" { + targets = [ "typst" ] } -target "typst-v0-11-1" { - inherits = ["shared"] - args = { - TYPST_VERSION = "v0.11.1" - TYPSTYLE_VERSION = "v0.11.32" - VARIANT = "1-bookworm" - } - labels = { - "org.opencontainers.image.title" = "Typst v0.11.1" - } - tags = [ - "ghcr.io/jmuchovej/typst-devcontainer:0.11.1", - "ghcr.io/jmuchovej/typst-devcontainer:latest", - ] -} +repo = "https://github.com/jmuchovej/devcontainers" +template = "${repo}/tree/main/src/templates/typst" +iamge = "ghcr.io/jmuchovej/devcontainers/typst" -target "typst-v0-11-0" { - inherits = ["shared"] - args = { - TYPST_VERSION = "v0.11.0" - TYPSTYLE_VERSION = "v0.11.20" - VARIANT = "1-bookworm" - } - labels = { - "org.opencontainers.image.title" = "Typst v0.11.0" - } - tags = [ - "ghcr.io/jmuchovej/typst-devcontainer:0.11.0", +target "typst" { + matrix = { + item = [ + {typst = "0.11.1", typstyle = "0.11.32", variant = "1-bookworm", }, + {typst = "0.11.0", typstyle = "0.11.20", variant = "1-bookworm", }, ] + } + name = "typst-v${replace(item.typst, ".", "-")}" + context = "./" + dockerfile = "Dockerfile" + platforms = [ "linux/amd64", "linux/arm64", ] + args = { + VARIANT = item.variant + TYPST_VERSION = "v${item.typst}" + TYPSTYLE_VERSION = "v${item.typstyle}" + } + labels = { + "org.opencontainers.image.source" = repo + "org.opencontainers.image.authors" = "John Muchovej " + "org.opencontainers.image.url" = "${template}" + "org.opencontainers.image.documentation" = "${template}/README.md" + "org.opencontainers.image.title" = "Typst v${item.typst}" + } + tags = [ "${image}:${item.typst}", LATEST == item.typst ? "${image}:latest" : "", ] }