Documentation
¶
Overview ¶
Package dockerclient is a minimal HTTP client for the Docker Engine API.
It exists to avoid pulling in the full github.com/docker/docker module, which is flagged by SCA scanners for several CVEs that affect dockerd (server-side) and the docker CLI — not the client SDK the agent actually uses. As of 2026-05 three of those CVEs have no upstream fix at all (CVE-2026-41567, -42306, -41568), so the only way to clear them from the SBOM is to remove the module entirely.
Only the three endpoints the agent needs are implemented:
- GET /_ping (connectivity check + API version detection)
- GET /version (used during API version negotiation)
- GET /containers/{id}/json (the only inspection call the agent makes)
Wire format follows the Docker Engine API as published at https://docs.docker.com/engine/api/ and matches what dockerd actually returns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ContainerInspect ¶
ContainerInspect returns the subset of the /containers/{id}/json response that the agent reads.
func (*Client) NegotiateAPIVersion ¶
NegotiateAPIVersion asks the daemon for its API version and pins the client to it. Silently falls back to the default if the daemon doesn't return one.
type ContainerJSON ¶
type ContainerJSON struct {
Name string
LogPath string
Config *Config
HostConfig *HostConfig
Mounts []MountPoint
NetworkSettings *NetworkSettings
}
ContainerJSON mirrors the fields of github.com/docker/docker/api/types.ContainerJSON that the agent reads. Anything not needed is intentionally omitted.
type EndpointSettings ¶
type EndpointSettings struct {
NetworkID string
}
type HostConfig ¶
type HostConfig struct {
LogConfig LogConfig
}
type MountPoint ¶
type NetworkSettings ¶
type NetworkSettings struct {
Ports map[Port][]PortBinding
Networks map[string]*EndpointSettings
}
type Port ¶
type Port string
Port is a "<port>/<protocol>" string (e.g., "80/tcp") matching docker's wire format.