A lightweight REST API that exposes bootc status --json over HTTP, making it easy for dashboards, monitoring systems, or other services to query the status of a bootc-managed system without direct shell access.
Built with Rust using Axum, with auto-generated OpenAPI documentation and embedded Swagger UI.
- Full
bootc statusexposed as structured JSON - Individual endpoints for booted, staged, and rollback entries
- Computed update-availability check
- Auto-generated OpenAPI spec with Swagger UI at
/swagger-ui/ - Prebuilt binaries for
linux/amd64andlinux/arm64
| Method | Path | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/api/v1/status |
Full bootc host status |
GET |
/api/v1/status/booted |
Currently booted image details |
GET |
/api/v1/status/staged |
Staged update (pending reboot) |
GET |
/api/v1/status/rollback |
Rollback image entry |
GET |
/api/v1/status/update-available |
Whether an update is available |
GET |
/swagger-ui/ |
Interactive Swagger UI |
GET |
/api-docs/openapi.json |
Raw OpenAPI spec |
The service listens on port 8005. See API.md for full request/response examples.
Download the latest release from GitHub Releases:
curl -fsSL -o /usr/local/bin/bootc-api \
"https://github.com/kubealex/bootc-api/releases/latest/download/bootc-api-linux-amd64"
chmod +x /usr/local/bin/bootc-apicargo build --releaseThe binary will be at target/release/bootc-api.
sudo cp target/release/bootc-api /usr/local/bin/
sudo cp bootc-api.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now bootc-apiVerify:
curl http://localhost:8005/health
# {"status":"ok"}To include bootc-api in a bootc image, add the following to your Containerfile:
# Install bootc-api status service
ARG TARGETARCH=amd64
RUN curl -fsSL -o /usr/local/bin/bootc-api \
"https://github.com/kubealex/bootc-api/releases/latest/download/bootc-api-linux-${TARGETARCH}" && \
chmod +x /usr/local/bin/bootc-api
COPY bootc-api.service /etc/systemd/system/bootc-api.service
RUN systemctl enable bootc-api.service
RUN firewall-offline-cmd --zone=public --add-port=8005/tcpThis requires a copy of bootc-api.service alongside your Containerfile with the following content:
[Unit]
Description=Bootc API Status Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/bootc-api
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetThe TARGETARCH build arg defaults to amd64 and can be overridden for arm64 builds.
The snippet:
- Downloads the prebuilt binary from GitHub Releases into
/usr/local/bin/ - Installs the systemd unit file
- Enables the service so it starts automatically on boot
- Opens port
8005/tcpin the firewall
After building and deploying the image, the API will be available at http://<host>:8005.
This project is open source. See the repository for license details.