skopeo

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2016 License: MIT Imports: 31 Imported by: 0

README

skopeo

Please be aware skopeo is still work in progress

skopeo is a command line utility which is able to inspect a repository on a Docker registry. By inspect I mean it fetches the repository's manifest and it is able to show you a docker inspect-like json output about a whole repository or a tag. This tool, in constrast to docker inspect, helps you gather useful information about a repository or a tag before pulling it (using disk space) - e.g. - which tags are available for the given repository? which labels the image has?

Examples:

# show repository's labels of rhel7:latest
$ skopeo registry.access.redhat.com/rhel7 | jq '.Config.Labels'
{
  "Architecture": "x86_64",
  "Authoritative_Registry": "registry.access.redhat.com",
  "BZComponent": "rhel-server-docker",
  "Build_Host": "rcm-img04.build.eng.bos.redhat.com",
  "Name": "rhel7/rhel",
  "Release": "38",
  "Vendor": "Red Hat, Inc.",
  "Version": "7.2"
}

# show repository's tags
$ skopeo docker.io/fedora | jq '.RepoTags'
[
  "20",
  "21",
  "22",
  "23",
  "heisenbug",
  "latest",
  "rawhide"
]

# show image's digest
$ skopeo docker.io/fedora:rawhide | jq '.Digest'
"sha256:905b4846938c8aef94f52f3e41a11398ae5b40f5855fb0e40ed9c157e721d7f8"

Private registries with authentication

When interacting with private registries, skopeo first looks for the Docker's cli config file (usually located at $HOME/.docker/config.json) to get the credentials needed to authenticate. When the file isn't available it falls back looking for --username and --password flags. The ultimate fallback, as Docker does, is to provide an empty authentication when interacting with those registries.

Examples:

# on my system
$ skopeo --help | grep docker-cfg
   --docker-cfg "/home/runcom/.docker"	Docker's cli config for auth

$ cat /home/runcom/.docker/config.json
{
	"auths": {
		"myregistrydomain.com:5000": {
			"auth": "dGVzdHVzZXI6dGVzdHBhc3N3b3Jk",
			"email": "stuf@ex.cm"
		}
	}
}

# we can see I'm already authenticated via docker login so everything will be fine
$ skopeo myregistrydomain.com:5000/busybox
{"Tag":"latest","Digest":"sha256:473bb2189d7b913ed7187a33d11e743fdc2f88931122a44d91a301b64419f092","RepoTags":["latest"],"Comment":"","Created":"2016-01-15T18:06:41.282540103Z","ContainerConfig":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["/bin/sh","-c","#(nop) CMD [\"sh\"]"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"DockerVersion":"1.8.3","Author":"","Config":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["sh"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"amd64","Os":"linux"}

# let's try now to fake a non existent Docker's config file
$ skopeo --docker-cfg="" myregistrydomain.com:5000/busybox
INFO[0000] Docker cli config file not found: stat : no such file or directory, falling back to --username and --password
FATA[0000] unable to ping registry endpoint http://myregistrydomain.com:5000/v0/
v2 ping attempt failed with error: Get http://myregistrydomain.com:5000/v2/: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
 v1 ping attempt failed with error: Get http://myregistrydomain.com:5000/v1/_ping: malformed HTTP response "\x15\x03\x01\x00\x02\x02"

# we can see the cli config isn't found so it looks for --username and --password
# but because I didn't provide them I can't auth to the registry and I receive the above error
INFO[0000] Docker cli config file not found: stat : no such file or directory, falling back to --username and --password

# passing --username and --password - we can see that everything goes fine despite an info showing
# cli config can't be found
$ skopeo --docker-cfg="" --username=testuser --password=testpassword myregistrydomain.com:5000/busybox
INFO[0000] Docker cli config file not found: stat : no such file or directory, falling back to --username and --password
{"Tag":"latest","Digest":"sha256:473bb2189d7b913ed7187a33d11e743fdc2f88931122a44d91a301b64419f092","RepoTags":["latest"],"Comment":"","Created":"2016-01-15T18:06:41.282540103Z","ContainerConfig":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["/bin/sh","-c","#(nop) CMD [\"sh\"]"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"DockerVersion":"1.8.3","Author":"","Config":{"Hostname":"aded96b43f48","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["sh"],"Image":"9e77fef7a1c9f989988c06620dabc4020c607885b959a2cbd7c2283c91da3e33","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"amd64","Os":"linux"}

If your cli config is found but it doesn't contain the necessary credentials for the queried registry you'll get an error. You can fix this by either logging in (via docker login) or providing --username and --password. Building

$ git clone https://github.com/runcom/skopeo
$ make

Installing

$ sudo make install

TODO

  • show repo tags via flag or when reference isn't tagged or digested
  • add tests (integration with deployed registries in container - Docker-like)
  • get rid of Docker (meaning make this work w/o needing Docker installed)

NOT TODO

  • provide a format flag - just use the awesome jq

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/Sirupsen/logrus
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/docker/distribution
Package distribution will define the interfaces for the components of docker distribution.
Package distribution will define the interfaces for the components of docker distribution.
_workspace/src/github.com/docker/distribution/cmd/registry-api-descriptor-template
registry-api-descriptor-template uses the APIDescriptor defined in the api/v2 package to execute templates passed to the command line.
registry-api-descriptor-template uses the APIDescriptor defined in the api/v2 package to execute templates passed to the command line.
_workspace/src/github.com/docker/distribution/context
Package context provides several utilities for working with golang.org/x/net/context in http requests.
Package context provides several utilities for working with golang.org/x/net/context in http requests.
_workspace/src/github.com/docker/distribution/digest
Package digest provides a generalized type to opaquely represent message digests and their operations within the registry.
Package digest provides a generalized type to opaquely represent message digests and their operations within the registry.
_workspace/src/github.com/docker/distribution/health
Package health provides a generic health checking framework.
Package health provides a generic health checking framework.
_workspace/src/github.com/docker/distribution/reference
Package reference provides a general type to represent any way of referencing images within the registry.
Package reference provides a general type to represent any way of referencing images within the registry.
_workspace/src/github.com/docker/distribution/registry
Package registry provides the main entrypoints for running a registry.
Package registry provides the main entrypoints for running a registry.
_workspace/src/github.com/docker/distribution/registry/api/v2
Package v2 describes routes, urls and the error codes used in the Docker Registry JSON HTTP API V2.
Package v2 describes routes, urls and the error codes used in the Docker Registry JSON HTTP API V2.
_workspace/src/github.com/docker/distribution/registry/auth
Package auth defines a standard interface for request access controllers.
Package auth defines a standard interface for request access controllers.
_workspace/src/github.com/docker/distribution/registry/auth/htpasswd
Package htpasswd provides a simple authentication scheme that checks for the user credential hash in an htpasswd formatted file in a configuration-determined location.
Package htpasswd provides a simple authentication scheme that checks for the user credential hash in an htpasswd formatted file in a configuration-determined location.
_workspace/src/github.com/docker/distribution/registry/auth/silly
Package silly provides a simple authentication scheme that checks for the existence of an Authorization header and issues access if is present and non-empty.
Package silly provides a simple authentication scheme that checks for the existence of an Authorization header and issues access if is present and non-empty.
_workspace/src/github.com/docker/distribution/registry/storage
Package storage contains storage services for use in the registry application.
Package storage contains storage services for use in the registry application.
_workspace/src/github.com/docker/distribution/registry/storage/cache
Package cache provides facilities to speed up access to the storage backend.
Package cache provides facilities to speed up access to the storage backend.
_workspace/src/github.com/docker/distribution/registry/storage/driver/azure
Package azure provides a storagedriver.StorageDriver implementation to store blobs in Microsoft Azure Blob Storage Service.
Package azure provides a storagedriver.StorageDriver implementation to store blobs in Microsoft Azure Blob Storage Service.
_workspace/src/github.com/docker/distribution/registry/storage/driver/base
Package base provides a base implementation of the storage driver that can be used to implement common checks.
Package base provides a base implementation of the storage driver that can be used to implement common checks.
_workspace/src/github.com/docker/distribution/registry/storage/driver/gcs
Package gcs implements the Google Cloud Storage driver backend.
Package gcs implements the Google Cloud Storage driver backend.
_workspace/src/github.com/docker/distribution/registry/storage/driver/middleware/cloudfront
Package middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
Package middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
_workspace/src/github.com/docker/distribution/registry/storage/driver/oss
Package oss implements the Aliyun OSS Storage driver backend.
Package oss implements the Aliyun OSS Storage driver backend.
_workspace/src/github.com/docker/distribution/registry/storage/driver/rados
Package rados implements the rados storage driver backend.
Package rados implements the rados storage driver backend.
_workspace/src/github.com/docker/distribution/registry/storage/driver/s3
Package s3 provides a storagedriver.StorageDriver implementation to store blobs in Amazon S3 cloud storage.
Package s3 provides a storagedriver.StorageDriver implementation to store blobs in Amazon S3 cloud storage.
_workspace/src/github.com/docker/distribution/registry/storage/driver/swift
Package swift provides a storagedriver.StorageDriver implementation to store blobs in Openstack Swift object storage.
Package swift provides a storagedriver.StorageDriver implementation to store blobs in Openstack Swift object storage.
_workspace/src/github.com/docker/distribution/uuid
Package uuid provides simple UUID generation.
Package uuid provides simple UUID generation.
_workspace/src/github.com/docker/docker/api/client
Package client provides a command-line interface for Docker.
Package client provides a command-line interface for Docker.
_workspace/src/github.com/docker/docker/dockerversion
Package dockerversion is auto-generated at build-time
Package dockerversion is auto-generated at build-time
_workspace/src/github.com/docker/docker/layer
Package layer is package for managing read only and read-write mounts on the union file system driver.
Package layer is package for managing read only and read-write mounts on the union file system driver.
_workspace/src/github.com/docker/docker/pkg/jsonlog
Package jsonlog provides helper functions to parse and print time (time.Time) as JSON.
Package jsonlog provides helper functions to parse and print time (time.Time) as JSON.
_workspace/src/github.com/docker/docker/pkg/parsers/kernel
Package kernel provides helper function to get, parse and compare kernel versions for different platforms.
Package kernel provides helper function to get, parse and compare kernel versions for different platforms.
_workspace/src/github.com/docker/docker/pkg/pools
Package pools provides a collection of pools which provide various data types with buffers.
Package pools provides a collection of pools which provide various data types with buffers.
_workspace/src/github.com/docker/docker/pkg/stringid
Package stringid provides helper functions for dealing with string identifiers
Package stringid provides helper functions for dealing with string identifiers
_workspace/src/github.com/docker/docker/pkg/tarsum
Package tarsum provides algorithms to perform checksum calculation on filesystem layers.
Package tarsum provides algorithms to perform checksum calculation on filesystem layers.
_workspace/src/github.com/docker/docker/pkg/term
Package term provides provides structures and helper functions to work with terminal (state, sizes).
Package term provides provides structures and helper functions to work with terminal (state, sizes).
_workspace/src/github.com/docker/docker/pkg/useragent
Package useragent provides helper functions to pack version information into a single User-Agent header.
Package useragent provides helper functions to pack version information into a single User-Agent header.
_workspace/src/github.com/docker/docker/registry
Package registry contains client primitives to interact with a remote Docker registry.
Package registry contains client primitives to interact with a remote Docker registry.
_workspace/src/github.com/docker/engine-api/types
Package types is used for API stability in the types and response to the consumers of the API stats endpoint.
Package types is used for API stability in the types and response to the consumers of the API stats endpoint.
_workspace/src/github.com/docker/engine-api/types/filters
Package filters provides helper function to parse and handle command line filter, used for example in docker ps or docker images commands.
Package filters provides helper function to parse and handle command line filter, used for example in docker ps or docker images commands.
_workspace/src/github.com/docker/engine-api/types/versions/v1p19
Package v1p19 provides specific API types for the API version 1, patch 19.
Package v1p19 provides specific API types for the API version 1, patch 19.
_workspace/src/github.com/docker/engine-api/types/versions/v1p20
Package v1p20 provides specific API types for the API version 1, patch 20.
Package v1p20 provides specific API types for the API version 1, patch 20.
_workspace/src/github.com/docker/go-connections/nat
Package nat is a convenience package for manipulation of strings describing network ports.
Package nat is a convenience package for manipulation of strings describing network ports.
_workspace/src/github.com/docker/go-connections/tlsconfig
Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.
Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.
_workspace/src/github.com/docker/go-units
Package units provides helper function to parse and print size and time units in human-readable format.
Package units provides helper function to parse and print size and time units in human-readable format.
_workspace/src/github.com/docker/libtrust
Package libtrust provides an interface for managing authentication and authorization using public key cryptography.
Package libtrust provides an interface for managing authentication and authorization using public key cryptography.
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/vbatts/tar-split/archive/tar
Package tar implements access to tar archives.
Package tar implements access to tar archives.
_workspace/src/github.com/vbatts/tar-split/tar/asm
Package asm provides the API for streaming assembly and disassembly of tar archives.
Package asm provides the API for streaming assembly and disassembly of tar archives.
_workspace/src/github.com/vbatts/tar-split/tar/storage
Package storage is for metadata of a tar archive.
Package storage is for metadata of a tar archive.
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/golang.org/x/net/context/ctxhttp
Package ctxhttp provides helper functions for performing context-aware HTTP requests.
Package ctxhttp provides helper functions for performing context-aware HTTP requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL