A small distributed lock server. Take a named lock, do the work, release it — blocking and FIFO-fair, from a single binary, with client libraries for nine languages.
Source and full documentation: https://github.com/freakmaxi/locking-center
latest — the most recent release<version> — a specific release, tagged <major>.2.<build>Multi-arch images are published for linux/amd64 and linux/arm64.
docker run -d --name locking-center \
-p 22119:22119 -p 22120:22120 -p 22121:22121 \
freakmaxi/locking-center:latest
The image runs as a non-root user, carries both lcd (the server) and lc-cli (management + lock CLI), and has a
HEALTHCHECK on the metrics endpoint. docker stop sends SIGTERM, which goes through the graceful shutdown path.
Inspect the lock table from the running container:
docker exec locking-center lc-cli --manager-address 127.0.0.1:22120 keys -d
| Port | Protocol | Purpose |
|---|---|---|
22119 | Binary TCP | Mutex — locking and unlocking, used by your services |
22120 | Binary TCP | Manager — management commands, used by lc-cli |
22121 | HTTP | Prometheus /metrics endpoint (also the container healthcheck) |
Only the mutex port needs to be reachable by your applications. Keep the manager port restricted — it can release every lock in the system.
| Variable | Default | Description |
|---|---|---|
BIND_ADDRESS | :22119 | Mutex bind address; the manager and metrics ports follow it at +1 and +2 |
DATA_PATH | (unset) | Path to a write-ahead log file; set it to keep held locks across restarts |
By default the lock table lives in memory and a restart drops every key. Mount a volume on /data and point DATA_PATH
at it:
docker run -d --name locking-center \
-p 22119:22119 -p 22120:22120 -p 22121:22121 \
-v locking-center-data:/data -e DATA_PATH=/data/locks.json \
freakmaxi/locking-center:latest
The service runs as uid and gid 22119. A named volume inherits /data's ownership from the image; a bind mount
does not, so chown 22119:22119 <directory> the host directory first — otherwise the process cannot create the file and
exits with code 4.
One tiny TCP protocol, clients for nine languages — Go, Rust, Python, Java, C#, JavaScript, C, C++ and Zig. See the client list.
GPL-3.0. The full documentation — wire protocol, Kubernetes manifest, Prometheus alert and design notes — lives in the GitHub repository.
Content type
Image
Digest
sha256:dfe87b776…
Size
8 MB
Last updated
about 1 month ago
docker pull freakmaxi/locking-center