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