feat(nodes): add Docker API backend#394
Conversation
runleveldev
left a comment
There was a problem hiding this comment.
The UI displays "Creds missing" for Docker nodes
Running our default templates fail since they use SystemD. Similar to how Proxmox checks for "application containers" and make the nessecary adjustments, this needs to check for "system containers" and make the nessacary adjustments (such as setting privileged: true)
7a542e3b9e12 ghcr.io/mieweb/opensource-server/base:latest "/sbin/init" 19 seconds ago Exited (255) 17 seconds ago hollow-urban-otter
|
The Docker credential badge was fixed in The systemd/default template handling was fixed in I pushed the requested review fixes as separate commits so each item is easier to inspect. Testing run:
I replied on the individual threads with the commit that addresses each item. I left the Docker real container ID thread unresolved because |
Summary
Closes #375.
This PR adds support for Docker-backed nodes by introducing a new
DockerApiimplementation that follows the existing Node API contract used byProxmoxApiandDummyApi.Changes include:
DockerApiusing Docker Engine's native HTTP API throughaxiosunix:///var/run/docker.socktcp://host:2375http://...https://...Node.api()to dispatch toDockerApiwhennodeType === "docker"node.hasApiAccess()Node.provisionableWhere(...)nodeTypesupport to node API serialization, create, and update routesunix:///var/run/docker.sockin the frontend formRelated Issue
Closes #375
Testing
Tested locally with the following checks:
Ran backend syntax checks successfully:
Ran frontend type-check successfully:
Ran whitespace checks successfully:
Tested
DockerApidirectly against local Docker using:Verified direct Docker lifecycle flow:
nginx:latestVerified the UI can create a Docker node with:
Attempted full UI container creation with
nginx:latest. The job selected the Docker node and Docker image path correctly, but failed with:This appears to be a local runtime/socket-mount limitation because the Manager runtime does not currently have the host Docker socket mounted. The
DockerApiitself was verified successfully through the direct lifecycle test above.Screenshots
Docker node form
Docker node created
Breaking Changes
None known.
Notes
Full end-to-end Docker provisioning from the UI requires the Manager runtime to have access to the configured Docker host. For local socket usage,
/var/run/docker.sockmust be mounted or otherwise reachable from the process running Manager.