From 321780496ecfed4b3ced886e0d847d3a4ecc3051 Mon Sep 17 00:00:00 2001 From: Tom Scott Date: Sat, 22 Nov 2025 21:40:52 -0500 Subject: [PATCH] add legacy releases task and info on how to build past releases --- docker-bake.hcl | 30 ++++++++++++++++++++++++++++++ docker-compose.yml | 11 ++++------- readme.md | 22 ++++++++++++++++------ 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index cfd0824..86b1421 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,19 +1,49 @@ +variable "UID" { + default = "1000" +} + +variable "GID" { + default = "1000" +} + group "edge" { targets = ["knot-edge", "spindle-edge"] } target "knot-edge" { context = "." + target = "knot" args = { TAG = "master" + UID = UID + GID = GID } tags = ["tngl/knot:edge"] } target "spindle-edge" { context = "." + target = "spindle" args = { TAG = "master" + UID = UID + GID = GID } tags = ["tngl/spindle:edge"] } + +target "releases" { + name = "${APP}-${replace(TAG, ".", "-")}" + context = "." + matrix = { + APP = ["knot", "spindle"] + TAG = ["v1.11.0-alpha", "v1.10.0-alpha", "v1.9.0-alpha", "v1.8.0-alpha"] + } + target = "${APP}" + args = { + TAG = "${TAG}" + UID = UID + GID = GID + } + tags = ["tngl/${APP}:${TAG}"] +} diff --git a/docker-compose.yml b/docker-compose.yml index 9bd1d36..d6f28b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,9 +4,9 @@ services: image: tngl/knot:latest build: target: knot - args: - UID: 1000 - GID: 1000 + args: &args + UID: ${UID:-1000} + GID: ${GID:-1000} TAG: ${TAG:-v1.11.0-alpha} tags: - tngl/spindle:latest @@ -29,10 +29,7 @@ services: image: tngl/spindle:latest build: target: spindle - args: - UID: 1000 - GID: 1000 - TAG: ${TAG:-v1.11.0-alpha} + args: *args tags: - tngl/spindle:latest - tngl/spindle:${TAG:-v1.11.0-alpha} diff --git a/readme.md b/readme.md index cd73ede..c7983df 100644 --- a/readme.md +++ b/readme.md @@ -36,20 +36,28 @@ docker bake knot docker bake spindle ``` -By default the `Dockerfile` will build the latest tag, but you can change it -with the `TAG` build argument. +By default this will build the latest tag, but you can target a specific tag +like so: ```sh -docker bake --build-arg TAG=v1.10.0-alpha +docker bake knot-v1-10-0-alpha spindle-v1-10-0-alpha ``` -The command above for example will build the `v1.10.0-alpha` tag. +The command above for example will build the `v1.10.0-alpha` tag for both the +`knot` and `spindle`. They're expressed as individual bake targets, so you can +also optionally specify just one to build at a specific version. + +You can also build all tagged releases: + +```sh +docker bake releases +``` By default it will also create a `git` / `spindle` user with user and group ID 1000:1000, but you can change it with the `UID` and `GID` build arguments. ```sh -docker bake --build-arg UID=$(id -u) --build-arg GID=$(id -g) +docker bake UID=$(id -u) GID=$(id -g) ``` The command above for example will create a user with the host user's UID and GID. @@ -62,7 +70,9 @@ it from the `:latest` release: ```sh docker bake edge -# or, with a specific target image +# +# or, with a specific target image... +# docker bake edge-knot docker bake edge-spindle ``` -- 2.51.2