[PR #308] [CLOSED] docker-lxc-daemon: Docker API to LXC translation daemon #292

Closed
opened 2026-10-15 12:50:36 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/gow/pull/308
Author: @JBailes
Created: 4/12/2026
Status: ❌ Closed

Base: master ← Head: aimee/session/d6cfef47


📝 Commits (2)

  • b215dff docker-lxc-daemon: Docker API to LXC translation daemon
  • 87992bb docker-lxc-daemon: add OCI image support via skopeo + umoci

📊 Changes

21 files changed (+3714 additions, -0 deletions)

View changed files

➕ docker-lxc-daemon/.gitignore (+1 -0)
➕ docker-lxc-daemon/Makefile (+39 -0)
➕ docker-lxc-daemon/cmd/docker-lxc-daemon/main.go (+74 -0)
➕ docker-lxc-daemon/go.mod (+10 -0)
➕ docker-lxc-daemon/go.sum (+8 -0)
➕ docker-lxc-daemon/internal/api/containers.go (+767 -0)
➕ docker-lxc-daemon/internal/api/exec.go (+292 -0)
➕ docker-lxc-daemon/internal/api/images.go (+102 -0)
➕ docker-lxc-daemon/internal/api/router.go (+81 -0)
➕ docker-lxc-daemon/internal/api/system.go (+104 -0)
➕ docker-lxc-daemon/internal/api/types.go (+246 -0)
➕ docker-lxc-daemon/internal/image/distro.go (+205 -0)
➕ docker-lxc-daemon/internal/image/registry.go (+116 -0)
➕ docker-lxc-daemon/internal/image/resolver.go (+146 -0)
➕ docker-lxc-daemon/internal/lxc/config.go (+251 -0)
➕ docker-lxc-daemon/internal/lxc/manager.go (+542 -0)
➕ docker-lxc-daemon/internal/lxc/network.go (+144 -0)
➕ docker-lxc-daemon/internal/lxc/syscall.go (+20 -0)
➕ docker-lxc-daemon/internal/oci/pull.go (+214 -0)
➕ docker-lxc-daemon/internal/store/store.go (+314 -0)

...and 1 more files

📄 Description

Summary

  • Adds docker-lxc-daemon/, a Go daemon that exposes a Docker-compatible Unix socket API backed by raw LXC containers (no Docker Engine, LXD, or Incus required)
  • Allows the standard docker CLI to manage LXC containers transparently — docker run, docker exec, docker ps, docker cp, port forwarding with -p, etc.
  • Targets GoW's use case of replacing Docker entirely with LXC on Proxmox hosts

Architecture

Docker CLI → /var/run/docker.sock → docker-lxc-daemon → liblxc → LXC containers
  • Image resolution: Maps image:tag to LXC download templates (distro images) or base + package install (app images like nginx, redis, postgres)
  • Networking: Dedicated gow0 bridge (10.100.0.0/24) with nftables NAT + DNAT port forwarding
  • Config: Rewrites cloned LXC configs to disable AppArmor/userns for Proxmox compatibility
  • State: JSON file store tracks containers, images, IP pool; reconciles on daemon restart

Supported commands

Command Status
docker run -d [-p host:container] Working
docker ps / docker inspect Working
docker exec [-it] Working
docker logs [-f] Working
docker stop / start / restart / kill Working
docker rm [-f] Working
docker cp (both directions) Working
docker top / rename Working
docker pull (distro + app images) Working
docker images / rmi Working
docker version / info Working

Build & install

apt install lxc-dev
cd docker-lxc-daemon
make deps && make build
sudo make install
sudo systemctl enable --now docker-lxc-daemon

Test plan

  • System endpoints (_ping, version, info)
  • Image pull — distro (ubuntu:22.04) and app (nginx:latest)
  • Container lifecycle (create, start, stop, restart, kill, rm, rm -f)
  • Exec — interactive TTY and non-TTY multiplexed
  • Port forwarding — localhost and external
  • DNS resolution inside containers
  • Docker cp — both directions, path traversal protection verified
  • State reconciliation after daemon restart
  • IP reclamation on container removal
  • Default command from app image registry (nginx runs without explicit cmd)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/gow/pull/308 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 4/12/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `aimee/session/d6cfef47` --- ### 📝 Commits (2) - [`b215dff`](https://github.com/games-on-whales/gow/commit/b215dff73837dd5c0d29f16005f4d29fa269925b) docker-lxc-daemon: Docker API to LXC translation daemon - [`87992bb`](https://github.com/games-on-whales/gow/commit/87992bb79ecd0726b0bb649718497c1c3522db8e) docker-lxc-daemon: add OCI image support via skopeo + umoci ### 📊 Changes **21 files changed** (+3714 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docker-lxc-daemon/.gitignore` (+1 -0) ➕ `docker-lxc-daemon/Makefile` (+39 -0) ➕ `docker-lxc-daemon/cmd/docker-lxc-daemon/main.go` (+74 -0) ➕ `docker-lxc-daemon/go.mod` (+10 -0) ➕ `docker-lxc-daemon/go.sum` (+8 -0) ➕ `docker-lxc-daemon/internal/api/containers.go` (+767 -0) ➕ `docker-lxc-daemon/internal/api/exec.go` (+292 -0) ➕ `docker-lxc-daemon/internal/api/images.go` (+102 -0) ➕ `docker-lxc-daemon/internal/api/router.go` (+81 -0) ➕ `docker-lxc-daemon/internal/api/system.go` (+104 -0) ➕ `docker-lxc-daemon/internal/api/types.go` (+246 -0) ➕ `docker-lxc-daemon/internal/image/distro.go` (+205 -0) ➕ `docker-lxc-daemon/internal/image/registry.go` (+116 -0) ➕ `docker-lxc-daemon/internal/image/resolver.go` (+146 -0) ➕ `docker-lxc-daemon/internal/lxc/config.go` (+251 -0) ➕ `docker-lxc-daemon/internal/lxc/manager.go` (+542 -0) ➕ `docker-lxc-daemon/internal/lxc/network.go` (+144 -0) ➕ `docker-lxc-daemon/internal/lxc/syscall.go` (+20 -0) ➕ `docker-lxc-daemon/internal/oci/pull.go` (+214 -0) ➕ `docker-lxc-daemon/internal/store/store.go` (+314 -0) _...and 1 more files_ </details> ### 📄 Description ## Summary - Adds `docker-lxc-daemon/`, a Go daemon that exposes a Docker-compatible Unix socket API backed by raw LXC containers (no Docker Engine, LXD, or Incus required) - Allows the standard `docker` CLI to manage LXC containers transparently — `docker run`, `docker exec`, `docker ps`, `docker cp`, port forwarding with `-p`, etc. - Targets GoW's use case of replacing Docker entirely with LXC on Proxmox hosts ## Architecture ``` Docker CLI → /var/run/docker.sock → docker-lxc-daemon → liblxc → LXC containers ``` - **Image resolution**: Maps `image:tag` to LXC download templates (distro images) or base + package install (app images like nginx, redis, postgres) - **Networking**: Dedicated `gow0` bridge (10.100.0.0/24) with nftables NAT + DNAT port forwarding - **Config**: Rewrites cloned LXC configs to disable AppArmor/userns for Proxmox compatibility - **State**: JSON file store tracks containers, images, IP pool; reconciles on daemon restart ## Supported commands | Command | Status | |---|---| | `docker run -d [-p host:container]` | Working | | `docker ps` / `docker inspect` | Working | | `docker exec [-it]` | Working | | `docker logs [-f]` | Working | | `docker stop` / `start` / `restart` / `kill` | Working | | `docker rm [-f]` | Working | | `docker cp` (both directions) | Working | | `docker top` / `rename` | Working | | `docker pull` (distro + app images) | Working | | `docker images` / `rmi` | Working | | `docker version` / `info` | Working | ## Build & install ```bash apt install lxc-dev cd docker-lxc-daemon make deps && make build sudo make install sudo systemctl enable --now docker-lxc-daemon ``` ## Test plan - [x] System endpoints (`_ping`, `version`, `info`) - [x] Image pull — distro (ubuntu:22.04) and app (nginx:latest) - [x] Container lifecycle (create, start, stop, restart, kill, rm, rm -f) - [x] Exec — interactive TTY and non-TTY multiplexed - [x] Port forwarding — localhost and external - [x] DNS resolution inside containers - [x] Docker cp — both directions, path traversal protection verified - [x] State reconciliation after daemon restart - [x] IP reclamation on container removal - [x] Default command from app image registry (nginx runs without explicit cmd) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:50:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/gow#292
No description provided.