Implements the Docker APIs for controlling LXC
  • Go 98.6%
  • Shell 0.9%
  • Makefile 0.5%
Find a file
JBailes 7171568494
Merge pull request #152 from games-on-whales/feat/pin-ct-vmid-and-cluster-wide-scan
lxc: see every node's guest ids, and let a caller pin one
2026-08-10 12:48:20 +02:00
.aimee fix(lxc): private tmpfs for /dev/input so virtual input nodes are per-container 2026-06-08 05:30:00 +00:00
.github/workflows chore: move Wolf-on-Proxmox recipe to proxmox-community-script repo (#144) 2026-07-05 16:41:57 +02:00
cmd/docker-lxc-daemon feat(pve): configurable default container memory (replace hardcoded 4GB) (#64) 2026-06-05 20:02:19 +02:00
deploy/proxmox/wolf chore: move Wolf-on-Proxmox recipe to proxmox-community-script repo (#144) 2026-07-05 16:41:57 +02:00
docs/proposals docs: propose Windows support (WSL2 + Hyper-V) with a Docker-Desktop-style install (#132) 2026-07-01 20:27:56 +02:00
internal lxc: see every node's guest ids, and let a caller pin one 2026-08-10 10:38:57 +00:00
packaging fix(gpu): tolerate nvidia-container-cli ldcache EPERM in the mount hook 2026-06-09 09:53:25 +00:00
scripts feat(release): auto-increment the version instead of requiring one (#137) 2026-07-05 13:30:19 +02:00
systemd Genericize: safe ephemeral GC, per-container storage/bridge, vendor-neutral labels 2026-04-17 15:36:22 +00:00
tests/integration Fix integration build test path for package cwd 2026-04-18 12:23:32 +00:00
.gitignore docker-lxc-daemon: Docker API to LXC translation daemon 2026-04-12 18:53:59 +00:00
deepdive.md Merge pull request #60 from games-on-whales/fix/host-network-lan-nic 2026-06-05 13:34:44 +02:00
go.mod fix(oci): coalesce concurrent pulls of the same image ref (#133) 2026-07-05 11:25:25 +02:00
go.sum oci: apply docker-load layers with a whiteout-aware applier (not tar -xf) 2026-06-24 15:12:00 +00:00
Makefile fix(net): gratuitous ARP on start so LAN peers relearn the CT MAC (#141) 2026-07-05 15:11:04 +02:00
readme.md feat(release): auto-increment the version instead of requiring one (#137) 2026-07-05 13:30:19 +02:00

docker-lxc-daemon

A Docker-compatible API that backs containers with LXC (optionally Proxmox CTs). Drop-in replacement for /var/run/docker.sock — use docker, docker-compose, or any Docker SDK without modification.

Install

The supported install is the prebuilt .deb — it depends only on the runtime LXC command-line tools (lxc-pve | lxc, nftables), never a build toolchain, so a host already running LXC/Proxmox has everything it needs.

On a Proxmox VE host (one-liner — downloads the latest release .deb and installs it):

bash -c "$(curl -fsSL https://raw.githubusercontent.com/games-on-whales/LXC2Docker/main/scripts/install-on-pve.sh)"

Manually, grab the .deb from the latest release:

sudo apt install ./docker-lxc-daemon_*.deb
sudo systemctl enable --now docker-lxc-daemon

The package installs the binary to /usr/bin, ships the systemd unit, creates the docker group, and Conflicts: the real Docker packages — so it cleanly replaces docker.io / docker-ce on the same socket.

Build from source (maintainers / CI only)

The daemon is pure Go — building needs only Go 1.21+ (no cgo, no liblxc-dev); containers are driven through the LXC command-line tools at runtime:

make build        # -> bin/docker-lxc-daemon
make deb          # -> bin/docker-lxc-daemon_<ver>_<arch>.deb  (what users install)
make tarball      # -> bin/docker-lxc-daemon_<ver>_linux_<arch>.tar.gz (binary + unit + hook)
sudo make install # dev convenience: -> /usr/local/bin + systemd unit

Releasing (maintainers)

make release auto-increments the version from the latest tag (patch by default), pushes the tag, and CI builds the .deb + tarball and publishes the GitHub release (with generated notes) automatically — no manual version bookkeeping:

make release              # patch bump: v0.1.4 -> v0.1.5
make release BUMP=minor   # or BUMP=major
make release VER=1.4.0    # pin an explicit version
# equivalently: ./scripts/release.sh [--minor|--major|X.Y.Z]

Testing

Run all checks:

make test

Individual targets:

make test-build       # compile check (`go test -run '^$' ./...`)
make test-unit        # unit tests
make test-integration # integration tests (`go test -tags=integration ./...`)

Run

sudo systemctl enable --now docker-lxc-daemon

Or directly:

sudo docker-lxc-daemon --socket=/var/run/docker.sock

Useful flags:

Flag Purpose
--socket Unix socket path (default /run/docker-lxc-daemon/docker.sock)
--lxcpath LXC container storage (default /var/lib/lxc)
--pve-storage Proxmox storage name — enables Proxmox CT mode
--min-free-disk-gb Low-space guardrail (default 2): refuse creates onto, and warn when, a watched filesystem drops below this. 0 disables
--cache-path Directory for bulky regenerable data (image tarballs, OCI unpacks, named volumes, build cache). Empty auto-defaults onto a ZFS --pve-storage pool, else the state dir — set it to keep bulk off the host root
--default-memory RAM for PVE CTs without --memory (e.g. 16G, 32G; empty = host RAM / no cap). Per-container override via the dld.memory label
--lan-bridge / --lan-prefix / --lan-gateway / --lan-subnet Dual-NIC LAN settings

Use

docker run -d --name web -p 8080:80 ubuntu:22.04
docker ps
docker exec -it web bash

Image refs map to LXC templates: ubuntu:22.04, debian:bookworm, alpine:3.19. Arbitrary OCI images are pulled via skopeo + umoci.

See deepdive.md for the why and how.