view release on metacpan or search on metacpan
.claude/rules/api-docker-rules.md view on Meta::CPAN
| Write/extend tests, add fixtures | `api-docker-test-writer` |
| The generated type model, the `API::Docker::Type` DSL, the drift checker, `spec/` | `api-docker-type-writer` |
| Commits, `Changes`, card â done, pre-release audit | `api-docker-release-manager` |
| POD and README | `api-docker-doc-writer` |
| Read-only research, audit, gap analysis | `api-docker-worker` ("read-only, change nothing") |
The two workers split by *question*, not by file â only `api-docker-engine-worker` carries the
Engine API reference.
Behavior-relevant = the HTTP transport and everything it returns, the resource API method
surface, entity wrappers, request/response encoding, error handling, `cpanfile`, and tests â
not prose, not `Changes`.
## Parallel fan-out â isolate the working tree
- **A subagent never mutates git** â no `stash`, `reset`, `checkout --`, `clean`, `add`,
`commit`; the orchestrator owns git.
- **Two or more code-touching agents at once must be isolated** â `isolation: "worktree"` or
sequentially, never in one tree.
- **A worktree may branch from a stale base.** Integrate by diff, never
`git checkout <branch> -- <file>` â that reverts main.
.claude/skills/api-docker-core/SKILL.md view on Meta::CPAN
code, in examples, and in tests.
- **Query-string booleans are normalised to `1`/`0`** (`$opts{all} ? 1 : 0`);
**JSON-body booleans are `\1`/`\0`** (see `Exec::start`), because the engine
type-checks the body but not the query string.
- **A `params` value that is a hashref is JSON-encoded automatically**, but
`filters` specifically goes through `API::Docker::Role::Filters`, which
normalises it into the map-of-string-to-array-of-string shape the engine
wants (wraps a bare scalar in an array, stringifies numbers, turns a JSON or
`\1`/`\0` boolean into `'true'`/`'false'`) and croaks on anything else â another
ref, `undef`, an empty string. Pass `filters => { dangling => ['true'] }` and
let the role do the rest; encoding it by hand double-encodes it.
- **Extra headers go through `headers =>`**, which strips CR/LF. Never
concatenate a header into the request string.
- `_uri_encode` deliberately leaves `/` and `:` raw so image names survive in
the path (`/images/library/nginx:1.25/push`).
- `sub push` and `sub kill` shadow Perl builtins inside their packages â that
is why `namespace::clean` is loaded; always call them as methods.
## Entities: generated types with composed methods, not hand-written classes
`_wrap`/`_wrap_list` build the object with `$class->from_data($data, client =>
.claude/skills/api-docker-type-model/SKILL.md view on Meta::CPAN
translates what it knows and forwards the rest verbatim. This is not
theoretical: a real Podman `/info` answers with fields the swagger does not
have, and `ImageSummary` still serves `VirtualSize`, which Docker dropped from
the spec after v1.41.
**A null is where that stops, and only for a field we know.** A known field an
engine sends as `null` is read as unset: the attribute stays `undef` and
`TO_JSON` writes no key for it. That is not a leak, it is the daemon's own
resolution â measured 2026-08-28 against Podman 5.8.4 (API 1.44), where
`POST /containers/create` answers `{}`, `{"Image":null}` and `{"Image":""}`
with byte-identical errors, because Go's `encoding/json` unmarshals a null
into the type's zero value and an absent field leaves that same zero value.
It holds outbound too, which is why `/images/{id}/history` answers
`"Tags": null` instead of omitting the field. An *unknown* field keeps its
null, because with no declared type there is no zero value to read it as, and
so does a null under a key the caller chose. Three shapes, three outcomes, on
purpose; the reasoning lives in `API::Docker::Role::Type`'s POD and
`t/type_fixture_passthrough.t` holds all three against the fixtures.
**`since` is documentation, never a check.** It records which API version
introduced a field, derived by diffing the specs in `spec/` against each
Architecture, transport invariants, the streaming and `X-Registry-Auth`
details, and the mock harness are in skill `api-docker-core` â that is
the source of truth, not this file.
## Layout
```
lib/API/Docker.pm # main client, version negotiation
lib/API/Docker/Role/HTTP.pm # HTTP/1.1 transport (unix:// + tcp://, TLS)
lib/API/Docker/Role/RegistryAuth.pm # X-Registry-Auth / AuthConfig encoding
lib/API/Docker/Role/Filters.pm # the `filters` query parameter, shape-normalised
lib/API/Docker/Role/Using.pm # `using`, the resource class clone that bounds a run of calls
lib/API/Docker/API/System.pm # /version, /info, /_ping, /auth, /events
lib/API/Docker/API/Containers.pm # container endpoints (incl. archive, attach)
lib/API/Docker/API/Images.pm # image endpoints (build, pull, push, tar, commit, ...)
lib/API/Docker/API/Networks.pm # network endpoints
lib/API/Docker/API/Volumes.pm # volume endpoints
lib/API/Docker/API/Exec.pm # exec endpoints
lib/API/Docker/API/Distribution.pm # /distribution registry manifest lookups
lib/API/Docker/API/Secrets.pm # /secrets
base64url-wrapped per the Docker Engine spec. Without `auth` the
header carries an empty JSON object so unauthenticated/public
pushes succeed where they previously failed at the HTTP layer.
0.001 2026-04-29 00:40:43Z
- Initial release as API::Docker
- Docker Engine API client with Unix socket and TCP support
- Auto-negotiate API version from daemon
- Container, Image, Network, Volume, System, and Exec APIs
- Pure Perl implementation with minimal dependencies (no LWP)
- HTTP/1.1 transport with chunked transfer encoding support
misc/agent-context/.claude/skills/docker-engine-api/examples/python/readonly_probe.py
misc/agent-context/.claude/skills/docker-engine-api/examples/python/tests/test_engine_helpers.py
misc/agent-context/.claude/skills/docker-engine-api/references/INDEX.md
misc/agent-context/.claude/skills/docker-engine-api/references/SOURCES.md
misc/agent-context/.claude/skills/docker-engine-api/references/clients/podman-and-other-engines.md
misc/agent-context/.claude/skills/docker-engine-api/references/clients/sdk-selection-and-language-notes.md
misc/agent-context/.claude/skills/docker-engine-api/references/clients/security-and-untrusted-input.md
misc/agent-context/.claude/skills/docker-engine-api/references/compatibility-policy.md
misc/agent-context/.claude/skills/docker-engine-api/references/containers/create-and-resource-policy.md
misc/agent-context/.claude/skills/docker-engine-api/references/containers/lifecycle-and-ownership.md
misc/agent-context/.claude/skills/docker-engine-api/references/http/request-shapes-and-encoding.md
misc/agent-context/.claude/skills/docker-engine-api/references/http/status-errors-and-retries.md
misc/agent-context/.claude/skills/docker-engine-api/references/images/build-context-and-buildkit-boundary.md
misc/agent-context/.claude/skills/docker-engine-api/references/images/pull-push-and-registry-auth.md
misc/agent-context/.claude/skills/docker-engine-api/references/observability/events-and-reconciliation.md
misc/agent-context/.claude/skills/docker-engine-api/references/observability/stats-and-accounting.md
misc/agent-context/.claude/skills/docker-engine-api/references/resources/archives-and-copy.md
misc/agent-context/.claude/skills/docker-engine-api/references/resources/networks-volumes-and-prune.md
misc/agent-context/.claude/skills/docker-engine-api/references/resources/swarm-and-compose-boundaries.md
misc/agent-context/.claude/skills/docker-engine-api/references/streams/hijack-attach-and-exec.md
misc/agent-context/.claude/skills/docker-engine-api/references/streams/json-progress-and-completion.md
lib/API/Docker.pm view on Meta::CPAN
return $self->$orig($method, $path, %opts);
};
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker - Perl client for the Docker Engine API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker.pm view on Meta::CPAN
=back
=item * B<Roles> - Behaviour shared across more than one class:
=over
=item * L<API::Docker::Role::HTTP> - HTTP transport layer
=item * L<API::Docker::Role::RegistryAuth> - X-Registry-Auth / AuthConfig
encoding, shared by Images, Plugins, Distribution and System
=item * L<API::Docker::Role::Filters> - the C<filters> query parameter,
normalised into the one shape the engine reads
=item * L<API::Docker::Role::Using> - C<using>, the resource class clone that
bounds a run of calls
=item * L<API::Docker::Role::Type> - the instance behaviour of every
generated L<API::Docker::Type> class: serialisation both ways and
C<unknown_fields>
lib/API/Docker.pm view on Meta::CPAN
=back
=head1 SEE ALSO
=over
=item * L<API::Docker::Role::HTTP> - HTTP transport implementation
=item * L<API::Docker::Role::RegistryAuth> - X-Registry-Auth / AuthConfig
encoding
=item * L<API::Docker::Role::Filters> - the C<filters> query parameter
=item * L<API::Docker::Role::Using> - C<using>, the resource class clone that
bounds a run of calls
=item * L<API::Docker::Type> - the DSL and attribute registry behind the
generated C<API::Docker::Type::*> classes
=item * L<API::Docker::Role::Type> - the generated classes' own behaviour
lib/API/Docker/API/Configs.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Configs - Docker Engine Configs API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Containers.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Containers - Docker Engine Containers API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Distribution.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Distribution - Docker Engine Distribution API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Distribution.pm view on Meta::CPAN
This module provides access to the Docker distribution endpoint
(C<GET /distribution/{name}/json>), which asks a I<registry> for the manifest
descriptor of an image reference without pulling the image.
Accessed via C<< $docker->distribution >>, or through
L<API::Docker::Role::Using/using> for a run of calls that needs its own
transport bound: C<< $docker->distribution->using(read_timeout => 5) >>.
The reference goes into the path unescaped, so its slashes and its tag stay
readable on the wire (C</distribution/myrepo/app:1.0/json>) -- that is what
the engine parses, and percent-encoding them breaks the reference.
=head2 A 404 means two different things
The endpoint answers 404 both when the registry does not have the reference
and when the engine has no such route, and the two want opposite handling.
The split here is:
=over
=item * L</inspect> is the endpoint, and croaks on B<any> error status, 404
lib/API/Docker/API/Distribution.pm view on Meta::CPAN
read as the registry's answer, i.e. as false, which is the behaviour a plain
"404 means no" would have had anyway.
=head1 SEE ALSO
=over
=item * L<API::Docker> - Main Docker client
=item * L<API::Docker::Role::RegistryAuth> - the shared C<X-Registry-Auth>
encoding
=item * L<API::Docker::API::Images> - Image management, including C<push> and
its C<X-Registry-Auth> handling
=back
=head1 SUPPORT
=head2 Issues
lib/API/Docker/API/Exec.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Exec - Docker Engine Exec API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Images.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Images - Docker Engine Images API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Images.pm view on Meta::CPAN
=item * L<API::Docker> - Main Docker client
=item * L<API::Docker::Role::Entity::Image> - the convenience methods the
returned objects carry
=item * L<API::Docker::Type::ImageSummary> - the fields C<list> returns
=item * L<API::Docker::Type::ImageInspect> - the fields C<inspect> returns
=item * L<API::Docker::Role::RegistryAuth> - the C<X-Registry-Auth>
encoding C<push> uses, shared with the other registry-facing endpoints
=item * L<API::Docker::Error::Stream> - Raised by C<build>, C<pull>, C<push>
and C<load>
=back
=head1 SUPPORT
=head2 Issues
lib/API/Docker/API/Networks.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Networks - Docker Engine Networks API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Plugins.pm view on Meta::CPAN
sub _wrap_list {
my ($self, $class, $list) = @_;
return [ map { $self->_wrap($class, $_) } @$list ];
}
# The plugin router calls registry.DecodeAuthConfig on the header and
# discards the error -- "Ignore invalid AuthConfig to increase compatibility
# with the existing API" -- so unlike /images/{name}/push, which rejects a
# missing header, an anonymous plugin operation needs no header at all. It is
# sent only when the caller asked for it. The encoding is
# API::Docker::Role::RegistryAuth; what stays here is the policy.
sub _auth_headers {
my ($self, $opts) = @_;
return () unless defined $opts->{auth};
return (headers => { 'X-Registry-Auth' => $self->_registry_auth_header($opts->{auth}) });
}
sub _privileges_body {
my ($self, $method, $remote, %opts) = @_;
lib/API/Docker/API/Plugins.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Plugins - Docker Engine Plugins API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Plugins.pm view on Meta::CPAN
=item * L<API::Docker::Role::Entity::Plugin> - the convenience methods the
returned objects carry
=item * L<API::Docker::Type::Plugin> - the fields L</list> and L</inspect>
return
=item * L<API::Docker> - Main Docker client
=item * L<API::Docker::Role::RegistryAuth> - the C<X-Registry-Auth>
encoding used here, shared with the other registry-facing endpoints
=item * L<API::Docker::API::Images> - Image endpoints, whose C<push>
sends that header on every call rather than only when credentials were
given
=item * L<API::Docker::Error::Stream> - Raised for a failure reported inside
a 200 event stream by L</install>, L</upgrade> and L</push>
=back
lib/API/Docker/API/Secrets.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Secrets - Docker Engine Secrets API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/System.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::System - Docker Engine System API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/API/Volumes.pm view on Meta::CPAN
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::API::Volumes - Docker Engine Volumes API
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Config.pm view on Meta::CPAN
croak $REFUSED;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Config - Removed in 0.004 -- replaced by API::Docker::Type::Config
=head1 VERSION
version 0.006
=head1 DESCRIPTION
lib/API/Docker/Container.pm view on Meta::CPAN
croak $REFUSED;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Container - Removed in 0.004 -- replaced by API::Docker::Type::ContainerSummary and ContainerInspectResponse
=head1 VERSION
version 0.006
=head1 DESCRIPTION
lib/API/Docker/Error/HTTP.pm view on Meta::CPAN
sub as_string { $_[0]->message . $_[0]->location }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Error::HTTP - Error status returned by the Docker Engine on the status line
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Error/Stream.pm view on Meta::CPAN
sub as_string { $_[0]->message . $_[0]->location }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Error::Stream - Failure reported inside a Docker Engine progress stream
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Error/Timeout.pm view on Meta::CPAN
sub as_string { $_[0]->message . $_[0]->location }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Error::Timeout - Read timeout while waiting for the Docker Engine
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Error/Truncated.pm view on Meta::CPAN
sub as_string { $_[0]->message . $_[0]->location }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Error::Truncated - The daemon closed before the response it announced was complete
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Image.pm view on Meta::CPAN
croak $REFUSED;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Image - Removed in 0.004 -- replaced by API::Docker::Type::ImageSummary and ImageInspect
=head1 VERSION
version 0.006
=head1 DESCRIPTION
lib/API/Docker/Network.pm view on Meta::CPAN
croak $REFUSED;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Network - Removed in 0.004 -- replaced by API::Docker::Type::Network
=head1 VERSION
version 0.006
=head1 DESCRIPTION
lib/API/Docker/Plugin.pm view on Meta::CPAN
croak $REFUSED;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Plugin - Removed in 0.004 -- replaced by API::Docker::Type::Plugin
=head1 VERSION
version 0.006
=head1 DESCRIPTION
lib/API/Docker/Role/Entity.pm view on Meta::CPAN
# its own belongs in this list.
sub _entity_attributes { return ('client') }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Role::Entity - The client reference an entity delegates through
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Role/Entity/Config.pm view on Meta::CPAN
}
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Role::Entity::Config - Config operations, on the generated config type
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Role/Entity/Container.pm view on Meta::CPAN
}
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Role::Entity::Container - Container operations, on the generated container types
=head1 VERSION
version 0.006
=head1 SYNOPSIS
lib/API/Docker/Role/Entity/Image.pm view on Meta::CPAN
}
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
API::Docker::Role::Entity::Image - Image operations, on the generated image types
=head1 VERSION
version 0.006
=head1 SYNOPSIS