API-Docker

 view release on metacpan or  search on metacpan

.claude/skills/getty-perl-release-author-getty/SKILL.md  view on Meta::CPAN

- `gitea` - Treat the remote host as Gitea/Forgejo (repository/bugtracker/homepage via GiteaMeta). Only needed for self-hosted instances — codeberg.org and the author's own are auto-detected. No effect when a GitHub remote exists
- `include_readme` - Ship README.md (excluded from the tarball by default)
- `no_install` - Resulting distribution can't be installed
- `generate_license` - Go back to a generated LICENSE: `@Basic` keeps its License plugin, no LicenseFile check is added. Default 0 — the bundle expects a committed LICENSE (see above)

### Identity & Metadata
- `author` - CPAN author name used for the authority
- `authority` - Override the authority, e.g. `authority = ETHER` when uploading modules owned by another author (default: the `author` value)

### XS with Alien
- `xs_alien = Alien::Foo` - Auto-configures MakeMaker::Awesome for XS+Alien
- `xs_object = Name` - Override XS object name (default: derived from Alien name)

### Versioning
- `task = 1` - TaskWeaver + AutoVersion
- `manual_version = x.x` - Manual version
- `major_version = 2` - Major version for AutoVersion
- `version_finder` - multi-value; forwarded as the `finder` option of RewriteVersion::Transitional + BumpVersionAfterRelease (default path) and PkgVersion (task/manual_version path). Defaults to `:MainModule` when `no_cpan` is set, otherwise unset.

### Build & Release
- `weaver_config` - PodWeaver `config_plugin` to use (default: the bundle's own)
- `installrelease_command` - Command used to install after release, instead of cpanm

### Docker
- `docker_image` - Image repository. Auto-adds one Docker::API plugin, which is a working Releaser on its own (no UploadToCPAN needed for non-CPAN dists)
- `docker_tags` - Whitespace-separated tag list (default: `latest %V %v`)
- `docker_local` - Build and tag the image, but don't push
- `docker_default` - Set to 0 to suppress the auto-added plugin when you configure builds exclusively through `[@Author::GETTY::Docker / name]` subsections

### Support
- `irc = #channel` - IRC channel
- `irc_server` - Server (default: irc.perl.org)
- `irc_user` - Username for SUPPORT section

### Git
- `release_branch` - Branch for releases (default: main)
- `tag_format` - Release tag format. Default `%v`, the bare `$VERSION` (`0.317`) — *not* a v-prefixed SemVer tag. Use `v%v.0` when the tag must satisfy strict vMAJOR.MINOR.PATCH (Perl's decimal `$VERSION` has only two parts, the `.0` supplies the p...
- `commit_files_after_release` - Multi-value; extra files folded into the release commit (via Git::Commit's `allow_dirty`). For artefacts a `run_before_release` hook rewrites, e.g. a sibling Python/JS version file

.claude/skills/getty-perl-release-author-getty/SKILL.md  view on Meta::CPAN

`allow_dirty` list, so an uncommitted edit stops nothing — it is folded into the release
snapshot silently, under a message naming only the version.

## Conventions

1. `copyright_year` IS used in dist.ini — GETTY has it in ALL distributions, do NOT remove it
2. No `=head1 SUPPORT/AUTHOR/COPYRIGHT` in POD
3. Use inline `=attr`/`=method` directly after code
4. Dependencies in `cpanfile`, not dist.ini
5. Changes file with `{{$NEXT}}` for unreleased
6. For XS+Alien modules: use `xs_alien = Alien::Foo` (auto-configures MakeMaker::Awesome)
7. `LICENSE` is generated once with `dzil genlicense` and **committed** — the build aborts without it

.claude/skills/kanban-issues-karr-cli/SKILL.md  view on Meta::CPAN

`karr pick` takes a lock ref and gives it back inside the same command, so normally there is nothing here to see. An agent that dies mid-pick leaves one behind. Locks expire on their own after `lock_timeout` (default `5m`, board config); this is how ...

### Handoff task for review

```bash
karr handoff ID --claim agent-1              # move to review, refresh claim
karr handoff ID --claim agent-1 --note "Done, needs QA" --timestamp
karr handoff ID --claim agent-1 --block "waiting for feedback" --release
```

Moves the task to the board's review column, refreshes the claim, and optionally appends a timestamped note, blocks, or releases the claim. On a board that configures a `review` status that is the target; a board without one hands off to its last non...

### Cross-board dependencies

`--depends-on` is board-local. When work here cannot proceed until something is
fixed in *another repository*, that link is a cross-board dependency:

```bash
# in the other repository -- raise the card and record where it came from
karr create "Fix the API" --escalated-from home#5

.claude/skills/kanban-issues-karr-cli/SKILL.md  view on Meta::CPAN


`restore` is destructive and replaces the entire `refs/karr/*` namespace.

### Destroy

```bash
karr destroy --yes
```

Deletes the entire `refs/karr/*` namespace from the repository and prunes the
remote board state too when a remote is configured. Prefer taking a
`karr backup` first.

### Helper refs

```bash
karr set-refs superpowers/spec/1234.md draft ready
karr set-refs superpowers/spec/1234.md < design.md    # multi-line payload
karr get-refs superpowers/spec/1234.md
```

.claude/skills/kanban-issues-karr-cli/SKILL.md  view on Meta::CPAN

# 2. Work on task...

# 3. Hand off for review
karr handoff ID --claim $NAME --note "Implementation complete" --timestamp

# 4. Or: release and mark done directly
karr edit ID --release
karr move ID done
```

Claims expire after the configured timeout (default: 1h). Statuses with `require_claim: true` enforce that moves include `--claim`.

Perl remains the primary local installation path, but a Docker alias around
`raudssus/karr:latest` or `raudssus/karr:user` works with the same commands when
another repository vendors `karr` instead of installing it locally.

## Helper-ref workflow

```bash
# 1. Publish a shared planning blob
karr set-refs superpowers/spec/1234.md initial draft ready for review

.claude/skills/perl-release-dist-ini/SKILL.md  view on Meta::CPAN

3. `[Prereqs]` / `cpanfile` - Dependencies
4. `[Version plugins]` - PkgVersion, AutoVersion, etc.
5. `[Meta plugins]` - MetaJSON, MetaYAML
6. `[Test plugins]` - Tests
7. `[Release plugins]` - UploadToCPAN, etc.
8. `[VCS plugins]` - Git::Commit, Git::Tag, etc.

## Key Questions

1. Which plugin bundle is used?
2. Are there custom plugins configured?
3. Are prereqs in dist.ini or cpanfile?
4. What release mechanism is configured?
5. What is the version in dist.ini — and does the bundle auto-bump it post-release or is it manual?

Changes  view on Meta::CPAN

    (replay and return) and refuses a container that is not running unless
    `require_running => 0`.
  - `containers->start`/`stop`/`restart`/`pause`/`unpause` return 1 when the
    call changed the container's state and 0 when it was already in it (the
    engine answers a no-op with 304), instead of always undef.
  - `containers->stats` croaks `API::Docker::Error::HTTP` when Podman reports
    a failure inside a 200 response, instead of handing the error object back
    as a reading.
  - New `API::Docker::API::Plugins` (`$docker->plugins`): `list`,
    `privileges`, `install`, `inspect`, `remove`, `enable`, `disable`,
    `upgrade`, `push` and `configure`. Needs a real Docker daemon; Podman
    serves no `/plugins`.
  - New `API::Docker::API::Secrets` and `API::Docker::API::Configs`: `list`,
    `create`, `inspect`, `update` and `remove`. `Data` is base64-encoded for
    the caller; `update` takes the current `Version.Index` as a mandatory
    concurrency token.
  - New `API::Docker::API::System::auth` (POST /auth): check registry
    credentials without pulling or pushing. A rejected credential croaks.
  - New `API::Docker::API::Distribution` (`inspect`/`exists`,
    GET /distribution/{name}/json): ask a registry for a manifest without
    pulling. `exists` answers `1`/`0` and tells a registry's own 404 apart

META.json  view on Meta::CPAN

   "generated_by" : "Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "perl_5"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : 2
   },
   "name" : "API-Docker",
   "prereqs" : {
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "develop" : {
         "recommends" : {
            "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007"
         },
         "requires" : {
            "Test::Pod" : "1.41",

META.yml  view on Meta::CPAN

---
abstract: 'Perl client for the Docker Engine API'
author:
  - 'Torsten Raudssus <getty@cpan.org>'
build_requires:
  Exporter: '0'
  Path::Tiny: '0'
  Test::More: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: API-Docker
provides:
  API::Docker:

lib/API/Docker.pm  view on Meta::CPAN

  # The docker CLI's own rule, read off cli/flags/options.go:
  #   dockerTLSVerify = os.Getenv(client.EnvTLSVerify) != ""
  # Every non-empty value turns TLS on, DOCKER_TLS_VERIFY=0 included. Perl
  # truthiness would read that '0' as off and disagree with the CLI on exactly
  # the value a user is most likely to type for "off", so the test is
  # defined-and-not-empty rather than a boolean one.
  return 0 unless defined $ENV{DOCKER_TLS_VERIFY}
    && $ENV{DOCKER_TLS_VERIFY} ne '';

  # And the CLI ignores TLS on a socket host without saying so
  # (cli/context/docker/load.go, "there's no need to configure TLS for a
  # socket connection"). Ignoring it here is not politeness: BUILD croaks on
  # tls => 1 with a non-tcp:// host, so a host-blind default would make a bare
  # API::Docker->new die on every unix:// machine that exports the variable.
  return $self->host =~ m{^tcp://} ? 1 : 0;
}


has cert_path => (
  is      => 'ro',
  default => sub { $ENV{DOCKER_CERT_PATH} },

lib/API/Docker.pm  view on Meta::CPAN


=head2 configs

Returns L<API::Docker::API::Configs> instance for config operations: C<list>,
C<create>, C<inspect>, C<update> and C<remove>.

=head2 plugins

Returns L<API::Docker::API::Plugins> instance for managed-plugin operations:
C<list>, C<privileges>, C<install>, C<inspect>, C<remove>, C<enable>,
C<disable>, C<upgrade>, C<push> and C<configure>.

=head2 negotiate_version

    $docker->negotiate_version;
    $docker->negotiate_version(read_timeout => 5, connect_timeout => 2);

Automatically negotiate the highest API version supported by the Docker daemon.
This is called automatically before the first API request if L</api_version>
is not set.

lib/API/Docker/API/Plugins.pm  view on Meta::CPAN

  my ($self, $name, %opts) = @_;
  croak __PACKAGE__ . '->push plugin name required' unless $name;
  return $self->client->post("/plugins/$name/push", undef,
    $self->_auth_headers(\%opts),
    %{ $self->_request_options },
    exists $opts{on_event} ? ( on_event => $opts{on_event} ) : ( ndjson => 1 ),
  );
}


sub configure {
  my ($self, $name, @settings) = @_;
  croak __PACKAGE__ . '->configure plugin name required' unless $name;

  # One ArrayRef or a plain list, and nothing after either: this method reads
  # no options at all. The ArrayRef form used to be where the transport bounds
  # went, because a trailing `read_timeout => 2` in the plain list would be two
  # more settings as far as this method can tell -- they now go on the resource
  # class instead (karr k74), and what is left is a form, not a split.
  if (ref $settings[0] eq 'ARRAY') {
    my $list = shift @settings;
    croak __PACKAGE__ . '->configure takes nothing after the ArrayRef of '
      . 'settings; a transport bound goes on the resource class, as '
      . '$docker->plugins->using(read_timeout => 5)->configure(...)'
      if @settings;
    @settings = @$list;
  }

  croak __PACKAGE__ . '->configure requires at least one setting, as an '
    . 'ArrayRef or a list of "KEY=value" strings' unless @settings;

  croak __PACKAGE__ . '->configure settings must be plain strings'
    if grep { ref $_ } @settings;

  return $self->client->post("/plugins/$name/set", \@settings,
    %{ $self->_request_options },
  );
}



1;

lib/API/Docker/API/Plugins.pm  view on Meta::CPAN

    $docker->plugins->install('vieux/sshfs:latest',
        privileges => $privileges,
    );
    $docker->plugins->enable('vieux/sshfs:latest');

    # Inspect
    my $plugin = $docker->plugins->inspect('vieux/sshfs:latest');
    say $plugin->name, $plugin->enabled ? ' (enabled)' : ' (disabled)';

    # Configure, upgrade, disable, remove
    $docker->plugins->configure('vieux/sshfs:latest', ['DEBUG=1']);
    $docker->plugins->upgrade('vieux/sshfs:latest', privileges => $privileges);
    $docker->plugins->disable('vieux/sshfs:latest');
    $docker->plugins->remove('vieux/sshfs:latest');

=head1 DESCRIPTION

This module provides access to the Docker managed-plugin endpoints
(C</plugins>).

Accessed via C<< $docker->plugins >>, or through

lib/API/Docker/API/Plugins.pm  view on Meta::CPAN

ones are generated classes rather than the raw HashRefs the old entity kept:
C<< $plugin->settings >> is an L<API::Docker::Type::Plugin::Settings> whose
C<< ->env >> is a list of C<KEY=value> strings, and C<< $plugin->config >> an
L<API::Docker::Type::Plugin::Config> whose C<< ->env >> is a list of
L<API::Docker::Type::PluginEnv> objects describing those same variables. The
entity's methods thread the plugin's name back through this class.

Everything else returns the decoded engine response as it came: L</privileges>
an ArrayRef of privilege HashRefs, L</install>, L</upgrade> and L</push> an
ArrayRef of progress events, and L</enable>, L</disable>, L</remove> and
L</configure> C<undef>.

=head2 client

Reference to L<API::Docker> client. Weak reference to avoid circular dependencies.

=head2 list

    my $plugins = $plugins->list;
    my $enabled = $plugins->list(filters => { enabled => ['true'] });

lib/API/Docker/API/Plugins.pm  view on Meta::CPAN

and discards a decoding failure, so an anonymous push needs no header. The
Engine API reference documents no header on this endpoint at all; the daemon
reads it.

Returns an ArrayRef of progress events, C<[]> when the engine sent no
progress. Failure is reported by the same two routes as L</install>.

C<push> shadows the Perl builtin inside this package, which is why
L<namespace::clean> is loaded. Always call it as a method.

=head2 configure

    $plugins->configure('vieux/sshfs:latest', ['DEBUG=1']);
    $plugins->configure('vieux/sshfs:latest', 'DEBUG=1', 'sshkey.source=/tmp');

Set a plugin's user-configurable settings (C<< POST /plugins/{name}/set >>).
The plugin must be disabled. Returns C<undef>.

Settings are C<KEY=value> strings, given either as one ArrayRef or as a plain
list. They name the mutable fields of the plugin's config -- the environment
variables, mount sources, devices and args that C<< $plugin->settings >>
reports; L</inspect> is how you find out which ones a given plugin has.

The engine replaces nothing it is not told about, and rejects a key the
plugin's config does not declare as mutable.

    $plugins->configure('vieux/sshfs:latest', ['DEBUG=1']);
    $plugins->configure('vieux/sshfs:latest', 'DEBUG=1');

Both forms mean the same call, and this method takes no options in either:
anything after the ArrayRef croaks rather than being read as a setting or
quietly dropped. To bound the request, clone the resource class --
C<< $docker->plugins->using(read_timeout => 5)->configure(...) >>, see
L<API::Docker::Role::Using>.

=head1 SEE ALSO

=over

=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>

lib/API/Docker/Plugin.pm  view on Meta::CPAN

# generates exactly xt/author/pod-syntax.t, which parses POD without loading
# anything, and xt/release/changes_has_content.t, which only reads Changes.
my $REFUSED =
  __PACKAGE__ . ' was removed in API::Docker 0.004 and this file is a stub'
  . ' with nothing in it: it ships only so that installing this'
  . ' release overwrites the working copy an earlier one left on'
  . ' disk. You have not hit a fault in the distribution. The'
  . ' plugins the daemon answers with are'
  . ' API::Docker::Type::Plugin (plugins->list and'
  . ' plugins->inspect), with the field names the swagger\'s own in'
  . ' snake_case, and inspect, enable, disable, remove, configure,'
  . ' upgrade and push are unchanged on them, composed in from'
  . ' API::Docker::Role::Entity::Plugin. This stub refuses';

# The croak below is what a caller normally hits. AUTOLOAD is for the one who
# swallowed it -- eval { require API::Docker::Plugin } and then called a
# method anyway; the answer has to be the same one, not a bare "Can't locate
# object method". DESTROY is defined so it does not reach AUTOLOAD.
sub AUTOLOAD { croak $REFUSED }
sub DESTROY  { }

lib/API/Docker/Plugin.pm  view on Meta::CPAN

development only, so the copy this stub overwrites is one a local install
put on disk -- which is the only reason the file is in the distribution at
all.

What to reach for instead:

=over

=item * L<API::Docker::Type::Plugin> -- what C<< plugins->list >> and C<< plugins->inspect >> return

=item * L<API::Docker::Role::Entity::Plugin> -- inspect, enable, disable, remove, configure, upgrade and push,
unchanged, composed into the above at load time

=back

Where this class mirrored the daemon's CamelCase verbatim, the generated
classes carry the swagger's own names in snake_case.
L<API::Docker::API::Plugins> documents the shape each method returns.

=head1 SEE ALSO

lib/API/Docker/Role/Entity/Plugin.pm  view on Meta::CPAN

  return $self->client->plugins->disable($self->name, %opts);
}


sub remove {
  my ($self, %opts) = @_;
  return $self->client->plugins->remove($self->name, %opts);
}


sub configure {
  my ($self, @settings) = @_;
  return $self->client->plugins->configure($self->name, @settings);
}


sub upgrade {
  my ($self, %opts) = @_;
  return $self->client->plugins->upgrade($self->name, %opts);
}


sub push {

lib/API/Docker/Role/Entity/Plugin.pm  view on Meta::CPAN

# Here rather than in API::Docker::API::Plugins, for the reason spelled out in
# API::Docker::Role::Entity::Container: loading this role is what puts the
# methods on the class.
#
# The clash check is not decoration. Moo composes a role into a class the
# class-wins way, so a generated accessor of the same name as a method here
# would silently keep its place and the method would be missing -- and the
# generated classes are written from a specification that grows fields
# without asking. This is the resource where the two vocabularies come
# closest: the class already declares `config`, `enabled` and `settings`
# beside this role's `configure` and `enable`. None of the seven names
# collides today; a future one says so on the first `use`.
{
  my @provided = Package::Stash->new(__PACKAGE__)->list_all_symbols('CODE');
  for my $class ('API::Docker::Type::Plugin') {
    my $fields = $class->docker_attributes;
    my @clash = sort grep { $fields->{$_} } @provided;
    croak __PACKAGE__ . ': ' . $class . ' declares ' . join(', ', @clash)
      . ' as a daemon field; the generated accessor would win over the '
      . 'method of that name and it would be missing without a word'
      if @clash;

lib/API/Docker/Role/Entity/Plugin.pm  view on Meta::CPAN

=head1 SYNOPSIS

    my $docker = API::Docker->new;
    my ($plugin) = @{ $docker->plugins->list };

    say $plugin->name;
    say $plugin->enabled ? 'enabled' : 'disabled';
    say join ', ', @{ $plugin->settings->env };

    $plugin->disable;
    $plugin->configure(['DEBUG=1']);
    $plugin->enable;

=head1 DESCRIPTION

The convenience methods of a Docker managed plugin. This role is composed, at
load time, into L<API::Docker::Type::Plugin>, the generated class the daemon
answers plugin requests with -- the same definition for
C<GET /plugins> and C<GET /plugins/{name}/json>, so
L<API::Docker::API::Plugins/list> and L<API::Docker::API::Plugins/inspect>
hand back one class and there is no list-versus-inspect shape to keep apart.

lib/API/Docker/Role/Entity/Plugin.pm  view on Meta::CPAN

C<< ->plugin_reference >> (C<docker.io/vieux/sshfs:latest>), which the engine
sets on the pull, upgrade and create paths only and omits entirely otherwise
rather than sending it as null -- so it reads as C<undef> for a plugin that
never came from a registry, and differs from the name outright for one
installed under a local one. That is exactly the case where L</upgrade>
needs C<remote> spelled out.

=head2 Two shapes of Env, one level apart

C<< $plugin->settings->env >> is a list of C<KEY=value> B<strings>, which is
what L</configure> takes. C<< $plugin->config->env >> is a list of
L<API::Docker::Type::PluginEnv> objects describing those same variables --
same field name, two shapes. The daemon flattens the one into the other when
the plugin is installed. L</configure> writes to the settings, never to the
config.

=head2 Not available on Podman

Managed plugins are a Docker feature: none of these endpoints exist on
Podman, so nothing in this role works against it. See
L<API::Docker::API::Plugins/"Not available on Podman">.

Why the methods are a role applied to a generated class rather than a class
of their own: L<API::Docker::Role::Entity/DESCRIPTION>.

lib/API/Docker/Role/Entity/Plugin.pm  view on Meta::CPAN

    $plugin->disable(force => 1);

Disable the plugin.

=head2 remove

    $plugin->remove(force => 1);

Remove the plugin. An enabled plugin is refused without C<force>.

=head2 configure

    $plugin->configure(['DEBUG=1']);
    $plugin->configure('DEBUG=1', 'sshkey.source=/tmp');

Set the plugin's user-configurable settings. The plugin must be disabled
first. The settings are the C<KEY=value> strings of
C<< $plugin->settings->env >>, not the objects of C<< $plugin->config->env >>
-- see L</"Two shapes of Env, one level apart">.

=head2 upgrade

    my $privileges = $docker->plugins->privileges($plugin->plugin_reference);
    $plugin->upgrade(remote => $plugin->plugin_reference,

lib/API/Docker/Type/ContainerdInfo.pm  view on Meta::CPAN


This is included for debugging purposes only.

=head2 address

The address of the containerd socket.

=head2 namespaces

The namespaces that the daemon uses for running containers and plugins in
containerd. These namespaces can be configured in the daemon configuration,
and are considered to be used exclusively by the daemon, Tampering with the
containerd instance may cause unexpected behavior.

As these namespaces are considered to be exclusively accessed by the daemon,
it is not recommended to change these values, or to change them to a value
that is used by other systems, such as cri-containerd. See
L<API::Docker::Type::ContainerdInfo::Namespaces>.

=head1 SUPPORT

lib/API/Docker/Type/ContainerdInfo/Namespaces.pm  view on Meta::CPAN


=head1 VERSION

version 0.004

=head1 DESCRIPTION

Generated from the inline C<Namespaces> schema of the C<ContainerdInfo>
definition in C<spec/v1.51.yaml>.

These namespaces can be configured in the daemon configuration, and are
considered to be used exclusively by the daemon, Tampering with the
containerd instance may cause unexpected behavior.

As these namespaces are considered to be exclusively accessed by the daemon,
it is not recommended to change these values, or to change them to a value
that is used by other systems, such as cri-containerd.

=head2 containers

The default containerd namespace used for containers managed by the daemon.

lib/API/Docker/Type/EndpointIPAMConfig.pm  view on Meta::CPAN


version 0.004

=head1 DESCRIPTION

Generated from the C<EndpointIPAMConfig> definition of C<spec/v1.51.yaml>.

=head2 ipv4_address

Undocumented upstream. An IPv4 address for the endpoint, C<172.20.30.33> in
the swagger's example. This is the address configured; the one the endpoint
ends up with is reported separately as
L<API::Docker::Type::EndpointSettings/ip_address>. Serialised as
C<IPv4Address> -- spelled out, because deriving it from the Perl name would
produce C<Ipv4Address>.

=head2 ipv6_address

Undocumented upstream. The IPv6 counterpart of L</ipv4_address>,
C<2001:db8:abcd::3033> in the swagger's example. Serialised as
C<IPv6Address> -- spelled out, because deriving it from the Perl name would

lib/API/Docker/Type/EndpointSpec.pm  view on Meta::CPAN

package API::Docker::Type::EndpointSpec;
# ABSTRACT: Properties that can be configured to access and load balance a service
our $VERSION = '0.004';
use API::Docker::Type;
use API::Docker::Type::EndpointPortConfig;
use namespace::clean;


docker mode => Str, enum => [qw( vip dnsrr )];


docker ports => [ 'EndpointPortConfig' ];

lib/API/Docker/Type/EndpointSpec.pm  view on Meta::CPAN

1;

__END__

=pod

=encoding UTF-8

=head1 NAME

API::Docker::Type::EndpointSpec - Properties that can be configured to access and load balance a service

=head1 VERSION

version 0.004

=head1 DESCRIPTION

Generated from the C<EndpointSpec> definition of C<spec/v1.51.yaml>.

=head2 mode

lib/API/Docker/Type/RegistryServiceConfig.pm  view on Meta::CPAN

Generated from the C<RegistryServiceConfig> definition of
C<spec/v1.51.yaml>.

=head2 insecure_registry_cidrs

List of IP ranges of insecure registries, using the CIDR syntax (L<RFC
4632|https://tools.ietf.org/html/4632>). Insecure registries accept
un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from unknown
CAs) communication.

By default, local registries (C<::1/128> and C<127.0.0.0/8>) are configured
as insecure. All other registries are secure. Communicating with an insecure
registry is not possible if the daemon assumes that registry is secure.

This configuration override this behavior, insecure communication with
registries whose resolved IP address is within the subnet described by the
CIDR syntax.

Registries can also be marked insecure by hostname. Those registries are
listed under C<IndexConfigs> and have their C<Secure> field set to C<false>.

lib/API/Docker/Type/Resources.pm  view on Meta::CPAN


CPU quota in units of 10^-9 CPUs.

=head2 oom_kill_disable

Disable OOM Killer for the container.

=head2 init

Run an init inside the container that forwards signals and reaps processes.
This field is omitted if empty, and the default (as configured on the
daemon) is used.

=head2 pids_limit

Tune a container's PIDs limit. Set C<0> or C<-1> for unlimited, or C<null>
to not change.

=head2 ulimits

A list of resource limits to set in the container. For example:

lib/API/Docker/Type/Service/Endpoint.pm  view on Meta::CPAN


=head1 DESCRIPTION

Generated from the inline C<Endpoint> schema of the C<Service> definition in
C<spec/v1.51.yaml>, which the swagger leaves undescribed. The specification
a service was asked for, alongside the ports and virtual IPs the swarm
actually gave it.

=head2 spec

Properties that can be configured to access and load balance a service. See
L<API::Docker::Type::EndpointSpec>.

=head2 ports

Undocumented upstream. The ports as published. In the swagger's C<Service>
example they are the very entry C<Spec.Ports> asked for -- C<tcp>, target
C<6379>, published C<30001>. See L<API::Docker::Type::EndpointPortConfig>.

=head2 virtual_ips

lib/API/Docker/Type/ServiceSpec.pm  view on Meta::CPAN

=head2 networks

Specifies which networks the service should attach to.

Deprecated: This field is deprecated since v1.44. The Networks field in
TaskSpec should be used instead. See
L<API::Docker::Type::NetworkAttachmentConfig>.

=head2 endpoint_spec

Properties that can be configured to access and load balance a service. See
L<API::Docker::Type::EndpointSpec>.

=head1 SUPPORT

=head2 Issues

Please report bugs and feature requests on GitHub at
L<https://github.com/Getty/p5-api-docker/issues>.

=head1 CONTRIBUTING

lib/API/Docker/Type/SwarmSpec/TaskDefaults.pm  view on Meta::CPAN


Generated from the inline C<TaskDefaults> schema of the C<SwarmSpec>
definition in C<spec/v1.51.yaml>.

=head2 log_driver

The log driver to use for tasks created in the orchestrator if unspecified
by a service.

Updating this value only affects new tasks. Existing tasks continue to use
their previously configured log driver until recreated. See
L<API::Docker::Type::SwarmSpec::TaskDefaults::LogDriver>.

=head1 SUPPORT

=head2 Issues

Please report bugs and feature requests on GitHub at
L<https://github.com/Getty/p5-api-docker/issues>.

=head1 CONTRIBUTING

lib/API/Docker/Type/SwarmSpec/TaskDefaults/LogDriver.pm  view on Meta::CPAN

=head1 VERSION

version 0.004

=head1 DESCRIPTION

Generated from the inline C<LogDriver> schema of C<SwarmSpec.TaskDefaults>
in C<spec/v1.51.yaml>.

Updating this value only affects new tasks. Existing tasks continue to use
their previously configured log driver until recreated.

=head2 name

The log driver to use as a default for new tasks.

=head2 options

Driver-specific options for the selected log driver, specified as key/value
pairs. B<The keys are the caller's data> and are never translated.

lib/API/Docker/Type/SystemInfo.pm  view on Meta::CPAN

L<API::Docker::Type::RegistryServiceConfig>.

=head2 generic_resources

User-defined resources can be either Integer resources (e.g, C<SSD=3>) or
String resources (e.g, C<GPU=UUID1>). See
L<API::Docker::Type::GenericResource>.

=head2 http_proxy

HTTP-proxy configured for the daemon. This value is obtained from the
L<C<HTTP_PROXY>|https://www.gnu.org/software/wget/manual/html_node/Proxies.html>
environment variable. Credentials (L<user info
component|https://tools.ietf.org/html/rfc3986#section-3.2.1>) in the proxy
URL are masked in the API response.

Containers do not automatically inherit this configuration.

=head2 https_proxy

HTTPS-proxy configured for the daemon. This value is obtained from the
L<C<HTTPS_PROXY>|https://www.gnu.org/software/wget/manual/html_node/Proxies.html>
environment variable. Credentials (L<user info
component|https://tools.ietf.org/html/rfc3986#section-3.2.1>) in the proxy
URL are masked in the API response.

Containers do not automatically inherit this configuration.

=head2 no_proxy

Comma-separated list of domain extensions for which no proxy should be used.

lib/API/Docker/Type/SystemInfo.pm  view on Meta::CPAN


Indicates if experimental features are enabled on the daemon.

=head2 server_version

Version string of the daemon.

=head2 runtimes

List of L<OCI compliant|https://github.com/opencontainers/runtime-spec>
runtimes configured on the daemon. Keys hold the "name" used to reference
the runtime.

The Docker daemon relies on an OCI compliant runtime (invoked via the
C<containerd> daemon) as its interface to the Linux kernel namespaces,
cgroups, and SELinux.

The default runtime is C<runc>, and automatically configured. Additional
runtimes can be configured by the user and will be listed here. See
L<API::Docker::Type::Runtime>. B<The keys are the caller's data> and are
never translated.

=head2 default_runtime

Name of the default OCI runtime that is used when starting containers.

The default can be overridden per-container at create time.

=head2 swarm

lib/API/Docker/Type/TaskSpec/ContainerSpec.pm  view on Meta::CPAN


=head2 isolation

Isolation technology of the containers running the service. (Windows only).
The swagger enumerates C<default>, C<process>, C<hyperv> and the empty
string.

=head2 init

Run an init inside the container that forwards signals and reaps processes.
This field is omitted if empty, and the default (as configured on the
daemon) is used.

=head2 sysctls

Set kernel namedspaced parameters (sysctls) in the container. The Sysctls
option on services accepts the same sysctls as the are supported on
containers. Note that while the same sysctls are supported, no guarantees or
checks are made about their suitability for a clustered environment, and
it's up to the user to determine whether a given sysctl will work properly
in a Service. B<The keys are the caller's data> and are never translated.

lib/API/Docker/Type/TaskSpec/ContainerSpec/Privileges/AppArmor.pm  view on Meta::CPAN


version 0.004

=head1 DESCRIPTION

Generated from the inline C<AppArmor> schema of
C<TaskSpec.ContainerSpec.Privileges> in C<spec/v1.51.yaml>.

=head2 mode

Undocumented upstream. The whole of what this object configures: AppArmor
left at the engine's default, or turned off. The swagger enumerates
C<default> and C<disabled>.

=head1 SUPPORT

=head2 Issues

Please report bugs and feature requests on GitHub at
L<https://github.com/Getty/p5-api-docker/issues>.

t/entity_roles.t  view on Meta::CPAN

    classes => ['API::Docker::Type::Network'],
    key     => 'id',
    methods => [qw( connect disconnect inspect remove )] },
  { role    => 'API::Docker::Role::Entity::Volume',
    classes => ['API::Docker::Type::Volume'],
    key     => 'name',
    methods => [qw( inspect remove )] },
  { role    => 'API::Docker::Role::Entity::Plugin',
    classes => ['API::Docker::Type::Plugin'],
    key     => 'name',
    methods => [qw( configure disable enable inspect push remove upgrade )] },
  { role    => 'API::Docker::Role::Entity::Secret',
    classes => ['API::Docker::Type::Secret'],
    key     => 'id',
    methods => [qw( inspect remove update version_index )] },
  { role    => 'API::Docker::Role::Entity::Config',
    classes => ['API::Docker::Type::Config'],
    key     => 'id',
    methods => [qw( decoded_data inspect remove update version_index )] },
);

t/plugins.t  view on Meta::CPAN

    'id';
  is $plugin->name, 'vieux/sshfs:latest', 'name';
  is $plugin->plugin_reference, 'docker.io/vieux/sshfs:latest',
    'plugin_reference -- the remote the plugin came from, which is not the '
    . 'local name once a plugin is installed under one';
  # Settings and Config used to be handed through as the HashRefs the engine
  # sent; the generated model inflates them into classes of their own, so
  # what they carry is reached by accessor a level down rather than by key.
  is_deeply $plugin->settings->env, ['DEBUG=0'],
    'settings is an API::Docker::Type::Plugin::Settings, and its env is the '
    . 'list of KEY=value strings configure() takes';
  is $plugin->config->interface->socket, 'sshfs.sock',
    'config likewise, two levels of generated class down';
  # The canned payload above is the Engine API reference's example and carries
  # no Config.Env, so the two shapes of that one key are asserted on the model
  # rather than on a payload invented to show them.
  my $settings_env = 'API::Docker::Type::Plugin::Settings'
    ->docker_attributes->{env}{isa}->display_name;
  my $config_env = 'API::Docker::Type::Plugin::Config'
    ->docker_attributes->{env}{isa}->display_name;
  like $settings_env, qr/Str/, 'Settings.Env is declared as strings';

t/plugins.t  view on Meta::CPAN

  $plugin->enable(timeout => 30);
  is request_line($c->written),
    'POST /v1.41/plugins/vieux/sshfs:latest/enable?timeout=30 HTTP/1.1',
    'enable: the name goes into the path and the option is passed on';

  $plugin->disable(force => 1);
  is request_line($c->written),
    'POST /v1.41/plugins/vieux/sshfs:latest/disable?force=1 HTTP/1.1',
    'disable';

  $plugin->configure(['DEBUG=1']);
  is request_line($c->written),
    'POST /v1.41/plugins/vieux/sshfs:latest/set HTTP/1.1', 'configure';
  is_deeply decode_json(request_body($c->written)), ['DEBUG=1'],
    'and the settings survive the extra hop as an array';

  $plugin->upgrade(privileges => $PRIVILEGES);
  is request_line($c->written),
    'POST /v1.41/plugins/vieux/sshfs:latest/upgrade?remote=vieux/sshfs:latest'
    . ' HTTP/1.1',
    'upgrade: remote defaults to the local name, which is why the entity '
    . 'carries plugin_reference for the renamed case';
  is_deeply decode_json(request_body($c->written)), $PRIVILEGES,

t/plugins.t  view on Meta::CPAN

};

subtest 'push: anonymous sends no auth header' => sub {
  my $c = fake_client(qq({"status":"Pushing"}\n));
  $c->plugins->push('myrepo/sshfs:v1');
  unlike $c->written, qr/X-Registry-Auth/i,
    'unlike images->push, which must always send one';
};

# ---------------------------------------------------------------------------
subtest 'configure: settings are a JSON array of strings' => sub {
  my $c = fake_client('');
  $c->plugins->configure('vieux/sshfs:latest', ['DEBUG=1', 'sshkey.source=/tmp']);

  is request_line($c->written),
    'POST /v1.41/plugins/vieux/sshfs:latest/set HTTP/1.1',
    'POST /plugins/{name}/set';
  is_deeply decode_json(request_body($c->written)),
    ['DEBUG=1', 'sshkey.source=/tmp'], 'body is the settings array';

  $c->plugins->configure('vieux/sshfs:latest', 'DEBUG=1');
  is_deeply decode_json(request_body($c->written)), ['DEBUG=1'],
    'a bare list is accepted and still sent as an array, so a single '
    . 'setting cannot become a JSON string by accident';
};

subtest 'configure: validation' => sub {
  my $docker = API::Docker->new(
    host        => 'unix:///nonexistent.sock',
    api_version => '1.41',
  );

  eval { $docker->plugins->configure('vieux/sshfs:latest') };
  like $@, qr/requires at least one setting/, 'no settings is refused';

  eval { $docker->plugins->configure('vieux/sshfs:latest', []) };
  like $@, qr/requires at least one setting/, 'an empty ArrayRef too';

  eval { $docker->plugins->configure('vieux/sshfs:latest', { DEBUG => 1 }) };
  like $@, qr/settings must be plain strings/,
    'a HashRef is refused rather than encoded as an object';

  eval { $docker->plugins->configure() };
  like $@, qr/plugin name required/, 'and the name is required';
};

# ---------------------------------------------------------------------------
subtest 'every name-taking method croaks without a name' => sub {
  my $docker = API::Docker->new(
    host        => 'unix:///nonexistent.sock',
    api_version => '1.41',
  );

t/timeout_forwarding.t  view on Meta::CPAN

  [ 'plugins->enable', 'POST /plugins/p/enable',
    'plugins' => sub { $_[0]->enable('p') } ],
  [ 'plugins->disable', 'POST /plugins/p/disable',
    'plugins' => sub { $_[0]->disable('p') } ],
  [ 'plugins->upgrade', 'POST /plugins/p/upgrade',
    'plugins' => sub { $_[0]->upgrade('p', privileges => []) } ],
  [ 'plugins->upgrade privileges pre-flight', 'GET /plugins/privileges',
    'plugins' => sub { $_[0]->upgrade('p', accept_privileges => 1) } ],
  [ 'plugins->push', 'POST /plugins/p/push',
    'plugins' => sub { $_[0]->push('p') } ],
  [ 'plugins->configure', 'POST /plugins/p/set',
    'plugins' => sub { $_[0]->configure('p', ['A=1']) } ],

  # -- distribution --------------------------------------------------------
  [ 'distribution->inspect', 'GET /distribution/alpine/json',
    'distribution' => sub { $_[0]->inspect('alpine') } ],
  [ 'distribution->exists', 'GET /distribution/alpine/json',
    'distribution' => sub { $_[0]->exists('alpine') } ],
);

# The option list the named endpoint was requested with, or a string saying
# why there is none -- which is_deeply then reports instead of an empty hash.

t/tls.t  view on Meta::CPAN

  {
    local $ENV{DOCKER_TLS_VERIFY} = '1';
    is client(tls => 0)->tls, 0, 'an explicit tls => 0 outranks the variable';
    delete local $ENV{DOCKER_TLS_VERIFY};
    is client(tls => 1)->tls, 1, 'and an explicit tls => 1 needs no variable';
  }
};

subtest 'DOCKER_TLS_VERIFY is ignored on a socket host' => sub {
  # The CLI ignores it there too -- cli/context/docker/load.go, "there's no
  # need to configure TLS for a socket connection", true for unix, npipe and
  # fd. Here it MUST be ignored rather than merely being tidy: BUILD croaks on
  # tls => 1 with a non-tcp:// host, so a host-blind default would make a bare
  # API::Docker->new die on every machine that talks to a local socket and
  # happens to export the variable -- this repo's own default host included.
  local $ENV{DOCKER_TLS_VERIFY} = '1';

  for my $host (
    'unix:///var/run/docker.sock',
    'unix:///run/user/1000/podman/podman.sock',
  ) {



( run in 1.935 second using v1.01-cache-2.11-cpan-aadc1410aed )