Convert Figma logo to code with AI

opencontainers logodistribution-spec

OCI Distribution Specification

1,053
233
1,053
101

Top Related Projects

The toolkit to pack, ship, store, and deliver container content

2,730

Build, Store, and Distribute your Applications and Containers

26,830

An open source trusted cloud native registry project that stores, signs, and scans content.

An open and reliable container runtime

Quick Overview

The opencontainers/distribution-spec repository contains the OCI Distribution Specification, which standardizes the distribution of content for container images and other artifacts. This specification defines an API for the distribution of content, ensuring interoperability between different container registries and clients.

Pros

  • Provides a standardized API for content distribution, improving interoperability
  • Supports multiple content types, not limited to just container images
  • Backed by the Open Container Initiative (OCI), ensuring industry-wide support
  • Enables consistent implementation across various container registries and tools

Cons

  • May require updates to existing systems to fully comply with the specification
  • Some advanced features of proprietary registries may not be covered by the standard
  • Adoption across the entire container ecosystem may take time
  • Potential overhead in implementing the full specification for simpler use cases

Getting Started

To get started with the OCI Distribution Specification:

  1. Visit the repository: https://github.com/opencontainers/distribution-spec
  2. Read the latest version of the specification in the spec.md file
  3. Review the API endpoints and their expected behaviors
  4. Implement the specification in your container registry or client software
  5. Use the provided conformance tests to ensure compliance with the specification

Note: This is not a code library, but a specification document. Implementation details will vary depending on the specific software being developed.

Competitor Comparisons

The toolkit to pack, ship, store, and deliver container content

Pros of distribution

  • Mature and widely adopted implementation of Docker Registry HTTP API V2
  • Includes a complete registry server and client libraries
  • Extensive documentation and community support

Cons of distribution

  • Focused on Docker-specific implementation rather than a generic specification
  • May include features or behaviors not standardized across all registry implementations
  • Potentially more complex for those seeking a bare-bones specification

Code comparison

distribution:

func (pr *proxyingRegistry) Manifests(ctx context.Context, repo reference.Named, options ...distribution.ManifestServiceOption) (distribution.ManifestService, error) {
    // Implementation details
}

distribution-spec:

// No direct code implementation, as it's a specification
// Example of a conformance test:
func TestPushManifest(t *testing.T) {
    // Test implementation details
}

Summary

distribution-spec is an Open Container Initiative (OCI) project that defines a specification for container image distribution. It aims to standardize how container images are distributed across different platforms and registries.

distribution, on the other hand, is the reference implementation of the Docker Registry HTTP API V2. It provides a complete registry server and client libraries, making it a more practical choice for those looking to implement or interact with a Docker registry.

While distribution-spec focuses on creating a vendor-neutral standard, distribution offers a battle-tested implementation with extensive features and community support. However, distribution may include Docker-specific elements that aren't part of the broader OCI specification.

2,730

Build, Store, and Distribute your Applications and Containers

Pros of Quay

  • Full-featured container registry implementation with a web UI
  • Supports advanced features like security scanning and build triggers
  • Actively maintained and developed by Red Hat

Cons of Quay

  • More complex to set up and manage compared to basic distribution implementations
  • Requires more resources to run due to its comprehensive feature set
  • Not as widely adopted as some other container registry solutions

Code Comparison

distribution-spec (OCI Distribution Specification):

name: distribution-spec
description: OCI Distribution Specification
version: v1.0.1

Quay:

REGISTRY_VERSION = "3.7.4"
QUAY_VERSION = "3.7.4"
QUAY_RELEASE = "1"

The distribution-spec repository focuses on defining the specification for container image distribution, while Quay is a full implementation of a container registry. The distribution-spec provides a standardized approach for container image distribution, which can be implemented by various registry solutions. Quay, on the other hand, offers a complete registry solution with additional features beyond the basic distribution capabilities.

Quay's codebase is more extensive and includes implementation details for various features, while the distribution-spec repository primarily contains documentation and schema definitions for the specification.

26,830

An open source trusted cloud native registry project that stores, signs, and scans content.

Pros of Harbor

  • Comprehensive container registry solution with advanced features like vulnerability scanning, image signing, and access control
  • User-friendly web interface for easy management and administration
  • Supports multi-tenancy and project-based isolation

Cons of Harbor

  • More complex setup and maintenance compared to the lightweight distribution-spec
  • Requires additional resources due to its feature-rich nature
  • May be overkill for simple container registry needs

Code Comparison

distribution-spec (example manifest schema):

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.oci.image.config.v1+json",
    "size": 7023,
    "digest": "sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7"
  }
}

Harbor (example configuration):

harbor:
  image:
    repository: goharbor/harbor-core
    tag: v2.5.0
  database:
    type: postgresql
    host: postgresql
    port: "5432"
  redis:
    host: redis
    port: "6379"

The distribution-spec focuses on defining a standard for container image distribution, while Harbor provides a full-featured registry implementation with additional management capabilities.

An open and reliable container runtime

Pros of containerd

  • More comprehensive container runtime with broader functionality
  • Active development and wider community support
  • Integrated with Kubernetes and other container orchestration systems

Cons of containerd

  • Larger codebase and potentially more complex to understand
  • May include features not needed for simpler container management tasks
  • Heavier resource footprint compared to minimal specifications

Code Comparison

distribution-spec (OCI Distribution Specification):

name: example
mediaType: application/vnd.oci.image.manifest.v1+json
size: 7682
digest: sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270

containerd:

import "github.com/containerd/containerd"

client, err := containerd.New("/run/containerd/containerd.sock")
container, err := client.NewContainer(ctx, "redis", spec)
task, err := container.NewTask(ctx, cio.NewCreator(cio.WithStdio))

The distribution-spec focuses on defining a standard for distributing container images, while containerd provides a full container runtime implementation. The distribution-spec example shows a manifest structure, whereas the containerd code demonstrates container creation and management.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

OCI Distribution Specification

GitHub Actions status

The OCI Distribution Spec project defines an API protocol to facilitate and standardize the distribution of content.

The specification can be found here.

This repository also provides Go types, and registry conformance tooling. The Go types and validation should be compatible with the current Go release; earlier Go releases are not supported.

Additional documentation about how this group operates:

Distributing OCI Images and other content

The OCI Distribution Spec is closely related to the OCI Image Format Specification project and the OCI Runtime Specification project.

The OCI Image Format Specification strictly defines the requirements for an OCI Image (container image), which consists of a manifest, an optional image index, a set of filesystem layers, and a configuration. The schema for OCI Image components is fully supported by the APIs defined in the OCI Distribution Specification.

The OCI Runtime Specification defines how to properly run a container "filesystem bundle" which fully adheres to the OCI Image Format Specification. The OCI Runtime Specification is relevant to the OCI Distribution Specification in that they both support OCI Images, and that container runtimes use the APIs defined in the OCI Distribution Specification to fetch pre-built container images and run them.

The OCI Distribution Specification (this project) is also designed generically enough to be leveraged as a distribution mechanism for any type of content. The format of uploaded manifests, for example, need not necessarily adhere to the OCI Image Format Specification so long as it references the blobs which comprise a given artifact.

FAQ

For questions about the OCI Distribution Specification, please see the FAQ.

For general questions about OCI, please see the FAQ on the OCI site.

Roadmap

The GitHub milestones lay out the path to the future improvements.

Extensions

The Distribution Specification Project includes a process and API for prototyping and testing extensions to the Distribution API.

We invite contributions, comments, and reviews to these extensions. These extensions will only move forward with significant support from registries, registry clients, and users.

Please see here for more details.

Contributing

Development happens on GitHub for the spec. Issues are used for bugs and actionable items and longer discussions can happen on the mailing list.

The specification and code is licensed under the Apache 2.0 license found in the LICENSE file of this repository.

Discuss your design

The project welcomes submissions, but please let everyone know what you are working on.

Before undertaking a nontrivial change to this specification, send mail to the mailing list to discuss what you plan to do. This gives everyone a chance to validate the design, helps prevent duplication of effort, and ensures that the idea fits. It also guarantees that the design is sound before code is written; a GitHub pull-request is not the place for high-level discussions.

Typos and grammatical errors can go straight to a pull-request. When in doubt, start on the mailing-list.

Meetings

Please see the OCI org repository README for the most up-to-date information on OCI contributor and maintainer meeting schedules. You can also find links to meeting agendas and minutes for all prior meetings.

Mailing List

You can subscribe and join the mailing list on Google Groups.

Chat

OCI discussion happens in the following chat rooms, which are all bridged together:

  • #general channel on OCI Slack
  • #opencontainers:matrix.org

Markdown style

To keep consistency throughout the Markdown files in the Open Container spec all files should be formatted one sentence per line. This fixes two things: it makes diffing easier with git and it resolves fights about line wrapping length. For example, this paragraph will span three lines in the Markdown source.

Git commit

Sign your work

The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from developercertificate.org):

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

then you just add a line to every git commit message:

Signed-off-by: Jane Smith <jane@gmail.com>

using your real name (sorry, no pseudonyms or anonymous contributions.)

You can add the sign off when creating the git commit via git commit -s.

Commit Style

Simple house-keeping for clean git history. Read more on How to Write a Git Commit Message or the Discussion section of git-commit(1).

  1. Separate the subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how
  • If there was important/useful/essential conversation or information, copy or include a reference
  1. When possible, one keyword to scope the change in the subject (i.e. "README: ...", "runtime: ...")