cloudbear/api-oci

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

pkg:composer/cloudbear/api-oci

v1.0.0 2025-09-24 14:37 UTC

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');