Community maintained Docker config for the knot server

add legacy releases task and info on how to build past releases

psychedeli.ca a4bd85cf c04d282f

verified
+50 -13
+30
docker-bake.hcl
··· 1 + variable "UID" { 2 + default = "1000" 3 + } 4 + 5 + variable "GID" { 6 + default = "1000" 7 + } 8 + 1 9 group "edge" { 2 10 targets = ["knot-edge", "spindle-edge"] 3 11 } 4 12 5 13 target "knot-edge" { 6 14 context = "." 15 + target = "knot" 7 16 args = { 8 17 TAG = "master" 18 + UID = UID 19 + GID = GID 9 20 } 10 21 tags = ["tngl/knot:edge"] 11 22 } 12 23 13 24 target "spindle-edge" { 14 25 context = "." 26 + target = "spindle" 15 27 args = { 16 28 TAG = "master" 29 + UID = UID 30 + GID = GID 17 31 } 18 32 tags = ["tngl/spindle:edge"] 19 33 } 34 + 35 + target "releases" { 36 + name = "${APP}-${replace(TAG, ".", "-")}" 37 + context = "." 38 + matrix = { 39 + APP = ["knot", "spindle"] 40 + TAG = ["v1.11.0-alpha", "v1.10.0-alpha", "v1.9.0-alpha", "v1.8.0-alpha"] 41 + } 42 + target = "${APP}" 43 + args = { 44 + TAG = "${TAG}" 45 + UID = UID 46 + GID = GID 47 + } 48 + tags = ["tngl/${APP}:${TAG}"] 49 + }
+4 -7
docker-compose.yml
··· 4 4 image: tngl/knot:latest 5 5 build: 6 6 target: knot 7 - args: 8 - UID: 1000 9 - GID: 1000 7 + args: &args 8 + UID: ${UID:-1000} 9 + GID: ${GID:-1000} 10 10 TAG: ${TAG:-v1.11.0-alpha} 11 11 tags: 12 12 - tngl/spindle:latest ··· 29 29 image: tngl/spindle:latest 30 30 build: 31 31 target: spindle 32 - args: 33 - UID: 1000 34 - GID: 1000 35 - TAG: ${TAG:-v1.11.0-alpha} 32 + args: *args 36 33 tags: 37 34 - tngl/spindle:latest 38 35 - tngl/spindle:${TAG:-v1.11.0-alpha}
+16 -6
readme.md
··· 36 36 docker bake spindle 37 37 ``` 38 38 39 - By default the `Dockerfile` will build the latest tag, but you can change it 40 - with the `TAG` build argument. 39 + By default this will build the latest tag, but you can target a specific tag 40 + like so: 41 41 42 42 ```sh 43 - docker bake --build-arg TAG=v1.10.0-alpha 43 + docker bake knot-v1-10-0-alpha spindle-v1-10-0-alpha 44 44 ``` 45 45 46 - The command above for example will build the `v1.10.0-alpha` tag. 46 + The command above for example will build the `v1.10.0-alpha` tag for both the 47 + `knot` and `spindle`. They're expressed as individual bake targets, so you can 48 + also optionally specify just one to build at a specific version. 49 + 50 + You can also build all tagged releases: 51 + 52 + ```sh 53 + docker bake releases 54 + ``` 47 55 48 56 By default it will also create a `git` / `spindle` user with user and group ID 1000:1000, 49 57 but you can change it with the `UID` and `GID` build arguments. 50 58 51 59 ```sh 52 - docker bake --build-arg UID=$(id -u) --build-arg GID=$(id -g) 60 + docker bake UID=$(id -u) GID=$(id -g) 53 61 ``` 54 62 55 63 The command above for example will create a user with the host user's UID and GID. ··· 62 70 63 71 ```sh 64 72 docker bake edge 65 - # or, with a specific target image 73 + # 74 + # or, with a specific target image... 75 + # 66 76 docker bake edge-knot 67 77 docker bake edge-spindle 68 78 ```