Download the PHP package cainy/laravel-dockhand without Composer
On this page you can find all versions of the php package cainy/laravel-dockhand. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cainy/laravel-dockhand
More information about cainy/laravel-dockhand
Files in cainy/laravel-dockhand
Package laravel-dockhand
Short Description A Laravel Package for interacting with registries following the Open Container Initiative Distribution Specification
License MIT
Homepage https://github.com/cainydev/laravel-dockhand
Informations about the package laravel-dockhand
Laravel Dockhand
A Laravel package for interacting with container registries following the OCI Distribution Specification.
Requirements
- PHP 8.4+
- Laravel 10, 11, 12, or 13
Installation
Install the package via Composer:
Publish the config file:
Configuration
Dockhand uses a multi-connection architecture. Each connection has its own driver, base URI, authentication, and logging configuration.
Supported Drivers
| Driver | Description |
|---|---|
distribution |
Standard OCI Distribution registry (Docker Registry, Harbor, etc.) |
zot |
Zot registry with extension support (search, user preferences, tag deletion) |
Supported Auth Drivers
| Auth Driver | Description |
|---|---|
jwt |
ECDSA JWT token authentication (for token-based registries) |
basic |
HTTP Basic authentication |
bearer |
Static Bearer token |
apikey |
API key authentication |
null |
No authentication |
Default Connection
The default connection is configured via environment variables:
Multiple Connections
Define additional connections in config/dockhand.php:
Usage
Basic Usage
Repositories & Tags
Manifests
Blobs
Blob Uploads
Deletion
Note: Tag deletion (by tag name instead of digest) is only supported by the Zot driver. See Zot Driver Extensions.
Multiple Connections
Zot Driver Extensions
The Zot driver provides additional features beyond the standard OCI Distribution spec.
Authentication
JWT (ECDSA)
JWT authentication is designed for token-based registry auth as described in the Docker Token Authentication Specification. Dockhand acts as the token authority — it signs JWTs with your private key, and the registry validates them using the corresponding public key.
Generate an ECDSA key pair:
Configure the connection:
The authority_name must match the issuer in the registry config, and registry_name must match the service.
Basic Auth
Bearer Token
API Key
No Auth
Webhook Notifications
Dockhand can receive and dispatch registry notification events as Laravel events.
Setup
-
Enable notifications in your
.env: -
Generate a notification token:
- Configure your registry to send notifications to Dockhand:
Available Events
Events extend one of two base classes depending on whether the target still exists:
| Event | Extends | Trigger |
|---|---|---|
ManifestPushedEvent |
RegistryEvent |
A manifest was pushed |
ManifestPulledEvent |
RegistryEvent |
A manifest was pulled |
BlobPushedEvent |
RegistryEvent |
A blob was pushed |
BlobPulledEvent |
RegistryEvent |
A blob was pulled |
BlobMountedEvent |
RegistryEvent |
A blob was mounted from another repository |
ManifestDeletedEvent |
RegistryBaseEvent |
A manifest was deleted |
BlobDeletedEvent |
RegistryBaseEvent |
A blob was deleted |
TagDeletedEvent |
RegistryBaseEvent |
A tag was deleted |
RepoDeletedEvent |
RegistryBaseEvent |
A repository was deleted |
Event Properties
All events (RegistryBaseEvent) have:
| Property | Type |
|---|---|
$id |
string |
$timestamp |
Carbon |
$action |
EventAction (pull, push, mount, delete) |
$targetDigest |
?string |
$targetRepository |
string |
$requestId |
string |
$requestAddr |
string |
$requestHost |
string |
$requestMethod |
string |
$requestUserAgent |
string |
$actorName |
?string |
$sourceAddr |
string |
$sourceInstanceId |
string |
Events extending RegistryEvent additionally have:
| Property | Type |
|---|---|
$targetMediaType |
MediaType |
$targetSize |
int |
$targetUrl |
string |
$targetTag |
?string |
Listening to Events
Token & Scope Helpers
Dockhand provides facades for building JWT tokens and registry scopes, useful when implementing custom token endpoints or testing.
Scope Facade
Token Facade
TokenService Facade
For low-level token operations:
Example Registry Configuration
A minimal example pairing Dockhand with a Distribution registry (e.g., in Docker Compose):
Testing
Contributing
Contributions are welcome! Just create an issue or pull request, and I'll take a look.
Security Vulnerabilities
If you find any security vulnerabilities, please contact me via mail at [email protected].
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-dockhand with dependencies
ext-openssl Version *
christian-riesen/base32 Version ^1.6
illuminate/contracts Version ^10.0||^11.0||^12.0||^13.0
laravel/forge-sdk Version ^3.21
lcobucci/clock Version ^3.3
lcobucci/jwt Version ^5.5
spatie/laravel-package-tools Version ^1.16