Skip to content

Using skopeo container image#

By now you know I hate to "install" things on the systems I work on, and that is because I have too many machines I carry work on. Hence, I prefer to containerize all the things and use handy aliases.

Here is one for skopeo to copy images between registries:

alias skopeo='sudo docker run --rm \
-v ~/.config/gcloud:/root/.config/gcloud:ro \
-v ~/.docker/config.json:/tmp/auth.json:ro \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker-credential-gcr:/usr/bin/docker-credential-gcr \
-v $(pwd):/workdir \
-w /workdir \
quay.io/skopeo/stable:v1.14'
$ skopeo --version
skopeo version 1.14.2

Note this quirky docker-credential-gcr binary mount, this is an authentication helper for skopeo to authenticate with GCP. Other clouds might require other helpers or file mounts.

A nice blog post on how to use skopeo different transports - https://www.redhat.com/sysadmin/7-transports-features

Comments