cloudbear / api-oci
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Forks: 0
pkg:composer/cloudbear/api-oci
Requires
- php: ^8.4
- cloudbear/class-mapper: ^v1.1
- guzzlehttp/guzzle: ^7.0
- nesbot/carbon: ^3.0
- psr/cache: ^3.0
- ramsey/uuid: ^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- phpstan/phpstan: ^2.1
This package is auto-updated.
Last update: 2025-09-24 12:40:12 UTC
README
- Create OCI Archives with multi-architecture and multi-layer support. (no build system)
- Partially implemented API for OCI repositories.
Contributions are welcome!
Getting Started
# Single file
$image = OciArchive::fromFile(
name: ImageName::parse('gitlab.com/cloudbear/open-source/php-api-oci/example:latest'),
file: new ContentFile(ChangeTypes::Addition, '/readme.txt', 'My image'),
);
# Multi layer
$image = OciArchive::fromConfig(
ImageName::parse('gitlab.com/cloudbear/open-source/php-api-oci/example:latest'),
new Config(PlatformVariants::ARM_64BIT, layers: [
new Layer([
new ContentFile(ChangeTypes::Addition, '/readme.txt', 'I\'m ARM'),
]),
]),
new Config(PlatformVariants::X86_64, layers: [
new Layer([
new ContentFile(ChangeTypes::Addition, '/readme.txt', 'I\'m X86_64'),
]),
]),
);
# Pushing to registry
new Client(new Credentials(config('oci.username'), config('oci.password')))
->push($image);
# Create local tar
$image->create('my-image.tar.gz');