diff --git a/readme.md b/readme.md index 11f7a33..cd73ede 100644 --- a/readme.md +++ b/readme.md @@ -4,42 +4,69 @@ > This is a community maintained repository, support is not guaranteed. Docker container and compose setup to run a [Tangled](https://tangled.org) knot -and host your own repository data. +and spindle, hosting your own repository data and CI. ## Pre-built Images -There is a [repository](https://hub.docker.com/r/tngl/knot) of pre-built images +There is a [repository](https://hub.docker.com/r/tngl) of pre-built images for tags starting at `v1.8.0-alpha` if you prefer. ``` docker pull tngl/knot:v1.10.0-alpha +docker pull tngl/spindle:v1.10.0-alpha ``` Note that these are *not* official images, you use them at your own risk. -## Building The Image +## Building The Images + +Both the knot and spindle images are built using the same `Dockerfile`, since +they're sourced from the same codebase and can therefore share a lot of the +build steps (such as `go mod download`), caching results between them. You +can build the images locally by running `docker bake`: + +```sh +docker bake +``` + +Optionally, choose a target image to build: + +```sh +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. ```sh -docker build -t knot:latest --build-arg TAG=master . +docker bake --build-arg TAG=v1.10.0-alpha ``` -The command above for example will build the latest commit on the `master` -branch. +The command above for example will build the `v1.10.0-alpha` tag. -By default it will also create a `git` user with user and group ID 1000:1000, +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 build -t knot:latest --build-arg UID=$(id -u) GID=$(id -g) +docker bake --build-arg UID=$(id -u) --build-arg GID=$(id -g) ``` The command above for example will create a user with the host user's UID and GID. This is useful if you are bind mounting the repositories and app folder on the host, as in the provided `docker-compose.yml` file. +You can also build the latest commit on `master` for both services by using +the `-edge` targets. These will build to a tag named `:edge` to distinguish +it from the `:latest` release: + +```sh +docker bake edge +# or, with a specific target image +docker bake edge-knot +docker bake edge-spindle +``` +