josepostiga/docker-registry-api-explorer

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple Docker Registry API Explorer

v0.5.0 2019-09-04 12:53 UTC

This package is auto-updated.

Last update: 2021-04-04 16:51:32 UTC


README

Latest Version on Packagist Build Status Quality Score StyleCI Total Downloads

Installation

You can install the package via composer:

composer require josepostiga/docker-registry-api-explorer

Note

This package needs an accessible official Docker Registry container to be up and running. Please refer to the Docker documentation to know how to boot a private registry.

Usage

Before using this package, you need to publish the configuration:

php artisan vendor:publish --tag=config

A new docker-registry.php config file will be published in the config folder. Inside of it, you'll find a few configuration items you need to modify according to your reality, specifically the "url", which is the publicly accessible url of the Docker registry you'll connect to.

Catalogs

The Docker Registry references "Catalogs" as a directory of available images repositories. Here's an example to get all available repositories:

class RepositoriesController
{
    public function index(DockerRegistryCatalogRepository $repository)
    {
        return $repository->list();
    }
}

Tags

Tags are associated with an image repository. To access this list, you need to pass the image you want to access the related tags. Here's an example to get all tags associated with an image repository:

class TagsController
{
    public function index(string $image)
    {
        // the $image variable is a route placeholder, automatically injected by Laravel as a controller method param.
        $repository = App::makeWith(DockerRegistryTagsRepository::class, [
            'image' => $image
        ]);

        return $repository->list();
    }
}

Manifests

A Manifest is a detailed document about what changes and information an image tag is referring to. Here's an example to get the manifest of a tag associated with an image repository:

class ManifestController
{
    public function index(string $image, string $tag)
    {
        // the $image and $tag variables are route placeholders, automatically injected by Laravel as controller method params.
        $manifest = App::makeWith(DockerRegistryManifestRepository::class, [
            'image' => $image,
            'tag' => $tag,
        ]);

        return $manifest->get();
    }
}

Note

Right now, this package only supports simple operations available on the official Docker Registry HTTP API.

Other types of registries are not supported, yet. Feel free to help out on that.

Testing

vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email me or Telegram instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.