Skip to content

build: add Alpine image for all kouja commands - #14

Merged
msdmazvoid merged 3 commits into
mainfrom
feat/alpine-container
Nov 14, 2026
Merged

msdmazvoid merged 3 commits into
mainfrom
feat/alpine-container

Conversation

@msdmazvoid

Copy link
Copy Markdown
Contributor

Summary

Adds a multi-stage Alpine image for the full command suite.

  • Builds the Preact admin UI and embeds it in the binaries.
  • Builds every package under cmd/: agent, backup, restore, CSI controller, CSI node, and the Terraform provider.
  • Defaults to kouja-agent, while any binary can be run directly (docker run IMAGE kouja-backup ...).
  • Installs the runtime tools the agent and CSI node invoke: lvm2, device-mapper, eudev, util-linux, nvme-cli, open-iscsi, e2fsprogs(-extra), and xfsprogs(-extra).
  • Includes entrypoint-node.sh and the example config.
  • Adds .dockerignore for build artifacts, generated UI assets, node_modules, and image archives.

Security

  • Runs apk upgrade --no-cache so the image picks up Alpine security fixes (notably zlib CVE-2026-4738 to 1.4-r0).
  • Bumps golang.org/x/net from 0.61.0 to 0.62.0 for CVE-2026-78661 and CVE-2026-97045.
  • Trivy scan of the final image: 0 vulnerabilities across OS packages and Go binaries.

Verification

  • docker build succeeds and all six binaries are present.
  • Each binary responds to -h.
  • kouja-agent -check-config -config deploy/config.example.yaml returns configuration valid.
  • go test -tags=unit passes for all packages.
  • Read-only vgs/lvs against host devices works with --privileged, /dev, and /run/lvm mounts.

Notes

The image runs as root and needs the host's LVM devices, configfs, and kernel modules, as required by the agent and CSI node. systemctl is not included, so the NVMe/TCP readiness check still requires a systemd host or an equivalent runtime arrangement.

voidstarit added 3 commits November 12, 2026 19:25
Add a multi-stage Dockerfile that builds the embedded admin UI and every command under cmd/. The runtime image installs the LVM, device-mapper, udev, util-linux, iSCSI, NVMe, and ext4/XFS tools used by the agent and CSI node, applies base package security upgrades, and defaults to kouja-agent while allowing every binary to be invoked directly.

Add .dockerignore to keep build artifacts, generated UI assets, node_modules, and image archives out of the build context.
Address CVE-2026-78661 and CVE-2026-97045 reported by Trivy against golang.org/x/net/html in the statically linked command binaries.
@msdmazvoid
msdmazvoid merged commit bd9923a into main Nov 14, 2026
2 checks passed
@msdmazvoid
msdmazvoid deleted the feat/alpine-container branch November 14, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant