josepostiga / docker-registry-api-explorer
Simple Docker Registry API Explorer
Fund package maintenance!
josepostiga
Requires
- php: ^7.2
- ext-json: *
- guzzlehttp/guzzle: ~6.0
- illuminate/support: ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0
Requires (Dev)
- orchestra/testbench: ^3.8|^4.0
- phpunit/phpunit: ^8.2
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2021-04-04 16:51:32 UTC
README
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.