[PR #7] [MERGED] [codex] Expand Portainer API compatibility #8

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

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/LXC2Docker/pull/7
Author: @JBailes
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @JBailes

Base: docker-lxc-daemon ← Head: aimee/session/8f4211c7


📝 Commits (2)

  • 73782b3 Expand Portainer API compatibility
  • bea61aa Improve Portainer stats and changes

📊 Changes

11 files changed (+1367 additions, -31 deletions)

View changed files

➕ internal/api/build.go (+18 -0)
📝 internal/api/containers.go (+74 -2)
➕ internal/api/containers_extra.go (+374 -0)
➕ internal/api/events.go (+40 -0)
📝 internal/api/images.go (+64 -0)
📝 internal/api/router.go (+23 -6)
📝 internal/api/system.go (+213 -11)
📝 internal/api/types.go (+204 -0)
➕ internal/api/volumes.go (+157 -0)
📝 internal/lxc/manager.go (+68 -0)
📝 internal/store/store.go (+132 -12)

📄 Description

What changed

This expands the Docker-compatible API surface so Portainer can drive more of the daemon without falling through to 404s or hollow responses.

The patch adds support for:

  • system/df
  • volumes/* with persistent local named volumes
  • richer networks/* responses, including the default gow bridge
  • /containers/{id}/stats
  • /containers/{id}/changes
  • image history, tag, and search
  • a real /events stream
  • Mounts support during container creation for named-volume requests

Why

Portainer was probing a broader Docker API surface than the daemon previously implemented. That left several pages partially broken or fully unusable even when the core container lifecycle worked.

This PR moves those gaps from missing/stubbed routes to Docker-shaped responses that Portainer can consume.

Impact

Portainer should now be able to:

  • render networks with real metadata instead of a hollow stub
  • render volumes and create named volumes
  • query disk-usage data through system/df
  • query container stats and filesystem changes without hitting 404s
  • consume image history/search/tag endpoints
  • receive streamed events instead of a permanently idle connection

Validation

Local:

  • GOCACHE=/tmp/go-build-cache go test ./...

Remote on root@192.168.1.253 after deploying the rebuilt daemon:

  • GET /system/df
  • GET /networks
  • GET /volumes
  • POST /volumes/create
  • GET /images/search?term=ubuntu
  • GET /images/<name>/history
  • POST /images/<name>/tag
  • GET /containers/<id>/changes
  • GET /containers/<id>/stats?stream=0
  • GET /events emitting a volume-create event

Remaining gaps

This still does not implement full Docker semantics for some Portainer features:

  • stats is lightweight and not real cgroup accounting yet
  • changes currently returns an empty diff rather than a real filesystem delta
  • build is still missing
  • image push returns 501 Not Implemented
  • swarm/stacks/services/tasks/secrets/configs/plugins remain unsupported

🔄 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/LXC2Docker/pull/7 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/17/2026 **Merged by:** [@JBailes](https://github.com/JBailes) **Base:** `docker-lxc-daemon` ← **Head:** `aimee/session/8f4211c7` --- ### 📝 Commits (2) - [`73782b3`](https://github.com/games-on-whales/LXC2Docker/commit/73782b335801f96270639642e74c163bdfa47121) Expand Portainer API compatibility - [`bea61aa`](https://github.com/games-on-whales/LXC2Docker/commit/bea61aa7cbbcb0ac2eebdcc18cdfba45389070ee) Improve Portainer stats and changes ### 📊 Changes **11 files changed** (+1367 additions, -31 deletions) <details> <summary>View changed files</summary> ➕ `internal/api/build.go` (+18 -0) 📝 `internal/api/containers.go` (+74 -2) ➕ `internal/api/containers_extra.go` (+374 -0) ➕ `internal/api/events.go` (+40 -0) 📝 `internal/api/images.go` (+64 -0) 📝 `internal/api/router.go` (+23 -6) 📝 `internal/api/system.go` (+213 -11) 📝 `internal/api/types.go` (+204 -0) ➕ `internal/api/volumes.go` (+157 -0) 📝 `internal/lxc/manager.go` (+68 -0) 📝 `internal/store/store.go` (+132 -12) </details> ### 📄 Description ## What changed This expands the Docker-compatible API surface so Portainer can drive more of the daemon without falling through to 404s or hollow responses. The patch adds support for: - `system/df` - `volumes/*` with persistent local named volumes - richer `networks/*` responses, including the default `gow` bridge - `/containers/{id}/stats` - `/containers/{id}/changes` - image `history`, `tag`, and `search` - a real `/events` stream - `Mounts` support during container creation for named-volume requests ## Why Portainer was probing a broader Docker API surface than the daemon previously implemented. That left several pages partially broken or fully unusable even when the core container lifecycle worked. This PR moves those gaps from missing/stubbed routes to Docker-shaped responses that Portainer can consume. ## Impact Portainer should now be able to: - render networks with real metadata instead of a hollow stub - render volumes and create named volumes - query disk-usage data through `system/df` - query container stats and filesystem changes without hitting 404s - consume image history/search/tag endpoints - receive streamed events instead of a permanently idle connection ## Validation Local: - `GOCACHE=/tmp/go-build-cache go test ./...` Remote on `root@192.168.1.253` after deploying the rebuilt daemon: - `GET /system/df` - `GET /networks` - `GET /volumes` - `POST /volumes/create` - `GET /images/search?term=ubuntu` - `GET /images/<name>/history` - `POST /images/<name>/tag` - `GET /containers/<id>/changes` - `GET /containers/<id>/stats?stream=0` - `GET /events` emitting a volume-create event ## Remaining gaps This still does not implement full Docker semantics for some Portainer features: - `stats` is lightweight and not real cgroup accounting yet - `changes` currently returns an empty diff rather than a real filesystem delta - `build` is still missing - image `push` returns `501 Not Implemented` - swarm/stacks/services/tasks/secrets/configs/plugins remain unsupported --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:51:15 +00:00
Sign in to join this conversation.
No labels
pull-request
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/LXC2Docker#8
No description provided.