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