Quick reminder: ayb makes it easy to create databases, share them with collaborators, and query them from a web application or the command line. I’ve been working on it for a few years, and am newly pushing myself to more publicly discuss releases, so here goes!

I’m excited to share v0.1.10 of ayb, which, in addition to a few quality-of-life improvements, introduces Docker images to make it easy to try and deploy ayb.

While the full details on how to use ayb Docker images are in the documentation, here’s a high-level introduction. To pull the latest version of the image:

docker pull ghcr.io/marcua/ayb

You can then create an alias for convenience:

alias ayb="docker run --network host ghcr.io/marcua/ayb ayb"

To run the server, you’ll need to create an ayb.toml configuration file (see Running a server), create a data directory for the databases, and map the configuration and data directory as volumes when running the container. For example:

docker run -v $(pwd)/ayb.toml:/ayb.toml \
          -v $(pwd)/ayb_data:/ayb_data \
          -p 5433:5433 \
          ghcr.io/marcua/ayb \
          ayb server --config /ayb.toml

Then use the client as normal:

ayb client --url http://127.0.0.1:5433 register marcua you@example.com

That’s it! One command to run a server, and one to run a client!

In shipping Docker support, I got to play with two new-to-me features:

  1. So that a new image can be automatically built and pushed every time a new version is tagged, I created a GitHub Action that triggers on any new vX.Y.Z tag, builds the image, pushes it to the GitHub Docker image repository, and tags the image appropriately. The action’s code shows just how much tooling exists to make this simple.
  2. This was my first time using multi-stage builds in Docker (check out FROM ... AS builder in the Dockerfile) to first create an image with the dependencies to build the project, and then to create the second image with just the binaries users will need to run ayb. The first container with all of the build tooling takes up ~2.7GB, whereas the container with the binaries takes up only ~150MB, which makes for a way faster docker pull and is way kinder to users’ machines and bandwidth.

One annoying limitation is that at the moment, only linux-amd64 images are built due to some bugs I encountered in building linux-arm64. Reach out or leave a comment on that PR if you need a linux-arm64 image.