# containers/skopeo architecture

> Architecture diagram of the GitHub repository containers/skopeo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/containers/skopeo
- Repository: https://github.com/containers/skopeo

## Overview

Skopeo is a daemonless CLI for inspecting and moving container images across registries and local storage. The main workflow is a user invoking a command, Skopeo dispatching it, and the operation reading from or writing to an image transport; inspect instead reads image metadata and returns formatted output. Other documented operations include delete, repository sync, tag listing, registry authentication, and image signing. The graph follows README-documented capabilities and the sampled command implementations; unsampled integrations are represented generically rather than as specific backends.

Main entry points: [`cmd/skopeo/main.go`](https://github.com/containers/skopeo/blob/main/cmd/skopeo/main.go) (Command dispatcher), [`cmd/skopeo/copy.go`](https://github.com/containers/skopeo/blob/main/cmd/skopeo/copy.go) (Copy images), [`cmd/skopeo/inspect.go`](https://github.com/containers/skopeo/blob/main/cmd/skopeo/inspect.go) (Inspect images), [`cmd/skopeo/sync.go`](https://github.com/containers/skopeo/blob/main/cmd/skopeo/sync.go) (Sync repositories)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and configuration"]
  node_entry["Command dispatcher<br/>[main.go]"]
end

subgraph group_image_ops["Image operations"]
  node_copy["Copy images<br/>[copy.go]"]
  node_inspect["Inspect images<br/>[inspect.go]"]
  node_delete["Delete images<br/>[delete.go]"]
  node_sync["Sync repositories<br/>[sync.go]"]
  node_tags["List tags<br/>[list_tags.go]"]
  node_layers["Fetch layers<br/>[layers.go]"]
  node_manifest["Manifest operations<br/>[manifest.go]"]
  node_inspect_output["Inspect output<br/>[output.go]"]
end

subgraph group_security["Authentication and signing"]
  node_login["Registry login<br/>[login.go]"]
  node_logout["Registry logout<br/>[logout.go]"]
  node_signing["Manifest signing<br/>[signing.go]"]
  node_sigstore_key["Sigstore keys"]
  node_auth_state[("Credential state")]
end

subgraph group_transports["Image transports"]
  node_image_sources["Image sources"]
  node_image_destinations["Image destinations"]
end

node_user(("CLI user"))
node_result["Command output"]

node_user -->|"invokes"| node_entry
node_entry -->|"dispatches"| node_copy
node_entry -->|"dispatches"| node_delete
node_entry -->|"dispatches"| node_inspect
node_entry -->|"dispatches"| node_sigstore_key
node_entry -.->|"dispatches"| node_sync
node_entry -.->|"dispatches"| node_tags
node_entry -.->|"dispatches"| node_login
node_entry -.->|"dispatches"| node_logout
node_entry -.->|"dispatches"| node_signing
node_copy -->|"reads image"| node_image_sources
node_copy -->|"writes image"| node_image_destinations
node_inspect -->|"reads metadata"| node_image_sources
node_inspect -->|"formats output"| node_inspect_output
node_inspect_output -->|"returns"| node_result
node_delete -->|"deletes image"| node_image_sources
node_sync -->|"reads repository"| node_image_sources
node_sync -->|"writes images"| node_image_destinations
node_tags -->|"reads tags"| node_image_sources
node_layers -->|"reads layers"| node_image_sources
node_manifest -.->|"operates on"| node_image_sources
node_login -->|"stores credentials"| node_auth_state
node_logout -->|"removes credentials"| node_auth_state
node_copy -->|"uses credentials"| node_auth_state
node_inspect -->|"uses credentials"| node_auth_state
node_signing -->|"writes signatures"| node_result
node_sigstore_key -->|"writes keys"| node_result

click node_entry "https://github.com/containers/skopeo/blob/main/cmd/skopeo/main.go"
click node_copy "https://github.com/containers/skopeo/blob/main/cmd/skopeo/copy.go"
click node_inspect "https://github.com/containers/skopeo/blob/main/cmd/skopeo/inspect.go"
click node_delete "https://github.com/containers/skopeo/blob/main/cmd/skopeo/delete.go"
click node_sync "https://github.com/containers/skopeo/blob/main/cmd/skopeo/sync.go"
click node_tags "https://github.com/containers/skopeo/blob/main/cmd/skopeo/list_tags.go"
click node_layers "https://github.com/containers/skopeo/blob/main/cmd/skopeo/layers.go"
click node_manifest "https://github.com/containers/skopeo/blob/main/cmd/skopeo/manifest.go"
click node_inspect_output "https://github.com/containers/skopeo/blob/main/cmd/skopeo/inspect/output.go"
click node_login "https://github.com/containers/skopeo/blob/main/cmd/skopeo/login.go"
click node_logout "https://github.com/containers/skopeo/blob/main/cmd/skopeo/logout.go"
click node_signing "https://github.com/containers/skopeo/blob/main/cmd/skopeo/signing.go"
click node_sigstore_key "https://github.com/containers/skopeo/blob/main/cmd/skopeo/generate_sigstore_key.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_user toneBlue
class node_copy,node_inspect,node_delete,node_sync,node_tags,node_layers,node_manifest,node_inspect_output toneAmber
class node_login,node_logout,node_signing,node_sigstore_key,node_auth_state toneMint
class node_image_sources,node_image_destinations toneRose
class node_result toneIndigo
```

## Components

### CLI and configuration

- [Command dispatcher](https://github.com/containers/skopeo/blob/main/cmd/skopeo/main.go): `cmd/skopeo/main.go`

### Image operations

- [Copy images](https://github.com/containers/skopeo/blob/main/cmd/skopeo/copy.go): `cmd/skopeo/copy.go`
- [Inspect images](https://github.com/containers/skopeo/blob/main/cmd/skopeo/inspect.go): `cmd/skopeo/inspect.go`
- [Delete images](https://github.com/containers/skopeo/blob/main/cmd/skopeo/delete.go): `cmd/skopeo/delete.go`
- [Sync repositories](https://github.com/containers/skopeo/blob/main/cmd/skopeo/sync.go): `cmd/skopeo/sync.go`
- [List tags](https://github.com/containers/skopeo/blob/main/cmd/skopeo/list_tags.go): `cmd/skopeo/list_tags.go`
- [Fetch layers](https://github.com/containers/skopeo/blob/main/cmd/skopeo/layers.go): `cmd/skopeo/layers.go`
- [Manifest operations](https://github.com/containers/skopeo/blob/main/cmd/skopeo/manifest.go): `cmd/skopeo/manifest.go`
- [Inspect output](https://github.com/containers/skopeo/blob/main/cmd/skopeo/inspect/output.go): `cmd/skopeo/inspect/output.go`

### Authentication and signing

- [Registry login](https://github.com/containers/skopeo/blob/main/cmd/skopeo/login.go): `cmd/skopeo/login.go`
- [Registry logout](https://github.com/containers/skopeo/blob/main/cmd/skopeo/logout.go): `cmd/skopeo/logout.go`
- [Manifest signing](https://github.com/containers/skopeo/blob/main/cmd/skopeo/signing.go): `cmd/skopeo/signing.go`
- [Sigstore keys](https://github.com/containers/skopeo/blob/main/cmd/skopeo/generate_sigstore_key.go): `cmd/skopeo/generate_sigstore_key.go`
- **Credential state**

### Image transports

- **Image sources**
- **Image destinations**

### Other components

- **CLI user**
- **Command output**

## Connections

- CLI user → Command dispatcher: invokes (evidence: `README.md`)
- Command dispatcher → Copy images: dispatches (evidence: `cmd/skopeo/main.go`)
- Command dispatcher → Delete images: dispatches (evidence: `cmd/skopeo/main.go`)
- Command dispatcher → Inspect images: dispatches (evidence: `cmd/skopeo/main.go`)
- Command dispatcher → Sigstore keys: dispatches (evidence: `cmd/skopeo/main.go`)
- Command dispatcher → Sync repositories: dispatches
- Command dispatcher → List tags: dispatches
- Command dispatcher → Registry login: dispatches
- Command dispatcher → Registry logout: dispatches
- Command dispatcher → Manifest signing: dispatches
- Copy images → Image sources: reads image (evidence: `README.md`)
- Copy images → Image destinations: writes image (evidence: `README.md`)
- Inspect images → Image sources: reads metadata (evidence: `cmd/skopeo/inspect.go`)
- Inspect images → Inspect output: formats output (evidence: `cmd/skopeo/inspect.go`)
- Inspect output → Command output: returns
- Delete images → Image sources: deletes image (evidence: `README.md`)
- Sync repositories → Image sources: reads repository (evidence: `README.md`)
- Sync repositories → Image destinations: writes images (evidence: `README.md`)
- List tags → Image sources: reads tags (evidence: `cmd/skopeo/list_tags.go`)
- Fetch layers → Image sources: reads layers (evidence: `cmd/skopeo/layers.go`)
- Manifest operations → Image sources: operates on
- Registry login → Credential state: stores credentials (evidence: `README.md`)
- Registry logout → Credential state: removes credentials (evidence: `README.md`)
- Copy images → Credential state: uses credentials (evidence: `README.md`)
- Inspect images → Credential state: uses credentials (evidence: `README.md`)
- Manifest signing → Command output: writes signatures (evidence: `cmd/skopeo/signing.go`)
- Sigstore keys → Command output: writes keys (evidence: `cmd/skopeo/generate_sigstore_key.go`)
