api-docker-core

Guides development of the API::Docker Perl client's HTTP transport, resource APIs, and typed entity model.

2|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/Getty/p5-api-docker --skill api-docker-core-getty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-docker-core
Source: https://github.com/Getty/p5-api-docker/tree/main/.claude/skills/api-docker-core
Command: npx skills add https://github.com/Getty/p5-api-docker --skill api-docker-core-getty

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on the API::Docker Perl client requires knowing non-obvious architectural invariants — how list/inspect wrap daemon responses into generated API::Docker::Type::* objects, why streaming endpoints need callbacks, and how X-Registry-Auth must be padded base64url — and getting any of these wrong produces subtle bugs that tests may not catch. ## Core Features & Use Cases - Architecture map: Documents the three-layer design (client, API::Docker::API::* resources, generated API::Docker::Type::* entities) and the rule that _request is the only way out of the process. - Invariant enforcement: Covers weak_ref client lifetime, query vs JSON body boolean normalization, filters handling via API::Docker::Role::Filters, and the removed hand-written entity classes. - Streaming and transport guidance: Explains on_event/on_frame/on_chunk callbacks, buffered NDJSON return-type instability, TLS via IO::Socket::SSL, and the padded base64url X-Registry-Auth requirement. - Use Case: When adding a new endpoint to API::Docker::API::Containers, use this Skill to route through _request correctly, wrap the response with _wrap, and write a fixture-driven test with Test::API::Docker::Mock. ## Quick Start Use the api-docker-core skill to add a new endpoint to the containers resource and write a mock-based test for it.

Frequently Asked Questions about api-docker-core

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new endpoint to the API::Docker Perl client?

Add a method to the appropriate API::Docker::API::* resource class and route it through _request (or get/post/put/delete_request), never opening its own socket. Wrap list/inspect responses with _wrap or _wrap_list so they return generated API::Docker::Type::* objects.

Why does my Docker events or stats call never return in Perl?

API::Docker buffers the whole response by default and sends Connection: close, so unbounded streams like events, stats, or logs(follow => 1) block forever. Pass one of the on_event, on_frame, or on_chunk callbacks to consume the response incrementally as it arrives.

Does API::Docker support TLS connections to the Docker daemon?

Yes, TLS is fully implemented for tcp:// connections using IO::Socket::SSL, configured with tls => 1 and a cert_path directory holding ca.pem, cert.pem, and key.pem. Unix sockets never encrypt, and IO::Socket::SSL loads only when a TLS connection is actually opened.

Why does Docker push fail with an X-Registry-Auth parse error?

The engine decodes X-Registry-Auth with Go's base64.URLEncoding, which requires padding; stripping '=' causes an unexpected EOF error even for anonymous pushes. API::Docker's _registry_auth_header produces padded base64url and must be sent on every push.

Why does calling remove on a listed image die with an undefined invocant?

The client composed onto each entity is a weak_ref, so API::Docker->new->images->list leaves every returned entity with client => undef. Keep the API::Docker client in a live variable for as long as you call methods on its entities.

When should I not use the api-docker-core skill?

Do not use it for generating the type model itself — the spec-to-type.pl generator and spec/ directory belong to the separate api-docker-type-model skill. This skill covers the client architecture, transport, resources, and test harness only.