bafb64
% CONTAINERS-TRANSPORTS 5 Containers Transports Man Page
a415a1
% Valentin Rothberg
a415a1
% April 2019
a415a1
a415a1
## NAME
a415a1
a415a1
containers-transports - description of supported transports for copying and storing container images
a415a1
a415a1
## DESCRIPTION
a415a1
a415a1
Tools which use the containers/image library, including skopeo(1), buildah(1), podman(1), all share a common syntax for referring to container images in various locations.
a415a1
The general form of the syntax is _transport:details_, where details are dependent on the specified transport, which are documented below.
a415a1
5f1c70
The semantics of the image names ultimately depend on the environment where
5f1c70
they are evaluated. For example: if evaluated on a remote server, image names
5f1c70
might refer to paths on that server; relative paths are relative to the current
5f1c70
directory of the image consumer.
5f1c70
a415a1
### **containers-storage**:[**[**storage-specifier**]**]{image-id|docker-reference[@image-id]}
a415a1
a415a1
An image located in a local containers storage.
a415a1
The format of _docker-reference_ is described in detail in the **docker** transport.
a415a1
a415a1
The _storage-specifier_ allows for referencing storage locations on the file system and has the format `[[driver@]root[+run-root][:options]]` where the optional `driver` refers to the storage driver (e.g., overlay or btrfs) and where `root` is an absolute path to the storage's root directory.
a415a1
The optional `run-root` can be used to specify the run directory of the storage where all temporary writable content is stored.
a415a1
The optional `options` are a comma-separated list of driver-specific options.
a415a1
Please refer to containers-storage.conf(5) for further information on the drivers and supported options.
a415a1
a415a1
### **dir:**_path_
a415a1
a415a1
An existing local directory _path_ storing the manifest, layer tarballs and signatures as individual files.
a415a1
This is a non-standardized format, primarily useful for debugging or noninvasive container inspection.
a415a1
a415a1
### **docker://**_docker-reference_
a415a1
a415a1
An image in a registry implementing the "Docker Registry HTTP API V2".
a415a1
By default, uses the authorization state in `$XDG_RUNTIME_DIR/containers/auth.json`, which is set using podman-login(1).
a415a1
If the authorization state is not found there, `$HOME/.docker/config.json` is checked, which is set using docker-login(1).
a415a1
The containers-registries.conf(5) further allows for configuring various settings of a registry.
a415a1
a415a1
Note that a _docker-reference_ has the following format: `name[:tag|@digest]`.
a415a1
While the docker transport does not support both a tag and a digest at the same time some formats like containers-storage do.
a415a1
Digests can also be used in an image destination as long as the manifest matches the provided digest.
a415a1
The digest of images can be explored with skopeo-inspect(1).
a415a1
If `name` does not contain a slash, it is treated as `docker.io/library/name`.
a415a1
Otherwise, the component before the first slash is checked if it is recognized as a `hostname[:port]` (i.e., it contains either a . or a :, or the component is exactly localhost).
a415a1
If the first component of name is not recognized as a `hostname[:port]`, `name` is treated as `docker.io/name`.
a415a1
a415a1
### **docker-archive:**_path[:{docker-reference|@source-index}]_
a415a1
a415a1
An image is stored in the docker-save(1) formatted file.
a415a1
_docker-reference_ must not contain a digest.
a415a1
Alternatively, for reading archives, @_source-index_ is a zero-based index in archive manifest
a415a1
(to access untagged images).
a415a1
If neither _docker-reference_ nor @_source_index is specified when reading an archive, the archive must contain exactly one image.
a415a1
a415a1
It is further possible to copy data to stdin by specifying `docker-archive:/dev/stdin` but note that the used file must be seekable.
a415a1
a415a1
### **docker-daemon:**_docker-reference|algo:digest_
a415a1
a415a1
An image stored in the docker daemon's internal storage.
a415a1
The image must be specified as a _docker-reference_ or in an alternative _algo:digest_ format when being used as an image source.
a415a1
The _algo:digest_ refers to the image ID reported by docker-inspect(1).
a415a1
bafb64
### **oci:**_path[:reference]_
a415a1
a415a1
An image compliant with the "Open Container Image Layout Specification" at _path_.
bafb64
Using a _reference_ is optional and allows for storing multiple images at the same _path_.
a415a1
bafb64
### **oci-archive:**_path[:reference]_
a415a1
a415a1
An image compliant with the "Open Container Image Layout Specification" stored as a tar(1) archive at _path_.
a415a1
a415a1
### **ostree:**_docker-reference[@/absolute/repo/path]_
a415a1
a415a1
An image in the local ostree(1) repository.
a415a1
_/absolute/repo/path_ defaults to _/ostree/repo_.
a415a1
a415a1
## Examples
a415a1
a415a1
The following examples demonstrate how some of the containers transports can be used.
a415a1
The examples use skopeo-copy(1) for copying container images.
a415a1
a415a1
**Copying an image from one registry to another**:
a415a1
```
a415a1
$ skopeo copy docker://docker.io/library/alpine:latest docker://localhost:5000/alpine:latest
a415a1
```
a415a1
a415a1
**Copying an image from a running Docker daemon to a directory in the OCI layout**:
a415a1
```
a415a1
$ mkdir alpine-oci
a415a1
$ skopeo copy docker-daemon:alpine:latest oci:alpine-oci
a415a1
$ tree alpine-oci
a415a1
test-oci/
a415a1
├── blobs
a415a1
│   └── sha256
a415a1
│       ├── 83ef92b73cf4595aa7fe214ec6747228283d585f373d8f6bc08d66bebab531b7
a415a1
│       ├── 9a6259e911dcd0a53535a25a9760ad8f2eded3528e0ad5604c4488624795cecc
a415a1
│       └── ff8df268d29ccbe81cdf0a173076dcfbbea4bb2b6df1dd26766a73cb7b4ae6f7
a415a1
├── index.json
a415a1
└── oci-layout
a415a1
a415a1
2 directories, 5 files
a415a1
```
a415a1
a415a1
**Copying an image from a registry to the local storage**:
a415a1
```
a415a1
$ skopeo copy docker://docker.io/library/alpine:latest containers-storage:alpine:latest
a415a1
```
a415a1
a415a1
## SEE ALSO
a415a1
a415a1
docker-login(1), docker-save(1), ostree(1), podman-login(1), skopeo-copy(1), skopeo-inspect(1), tar(1), container-registries.conf(5), containers-storage.conf(5)
a415a1
a415a1
## AUTHORS
a415a1
a415a1
Miloslav Trmač <mitr@redhat.com>
a415a1
Valentin Rothberg <rothberg@redhat.com>