skopeo
may already be packaged in your distribution.
$ sudo dnf -y install skopeo
$ sudo dnf -y install skopeo
Newer Skopeo releases may be available on the repositories provided by the Kubic project. Beware, these may not be suitable for production environments.
on CentOS 8:
$ sudo dnf -y module disable container-tools
$ sudo dnf -y install 'dnf-command(copr)'
$ sudo dnf -y copr enable rhcontainerbot/container-selinux
$ sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_8/devel:kubic:libcontainers:stable.repo
$ sudo dnf -y install skopeo
on CentOS 8 Stream:
sudo dnf -y module disable container-tools
sudo dnf -y install 'dnf-command(copr)'
sudo dnf -y copr enable rhcontainerbot/container-selinux
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_8_Stream/devel:kubic:libcontainers:stable.repo
sudo dnf -y install skopeo
$ sudo yum -y install skopeo
Newer Skopeo releases may be available on the repositories provided by the Kubic project. Beware, these may not be suitable for production environments.
$ sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo
$ sudo yum -y install skopeo
$ sudo zypper install skopeo
$ sudo apk add skopeo
$ brew install skopeo
$ nix-env -i skopeo
Debian (10 and newer including Raspbian) and Ubuntu (18.04 and newer): Packages are available via the Kubic project repositories:
# Debian Unstable/Sid:
$ echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Unstable/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Unstable/Release.key | sudo apt-key add -
# Debian Testing:
$ echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Testing/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Testing/Release.key | sudo apt-key add -
# Debian 10:
$ echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/Release.key | sudo apt-key add -
# Raspbian 10:
$ echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Raspbian_10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Raspbian_10/Release.key | sudo apt-key add -
# Ubuntu (18.04, 19.04, 19.10 and 20.04):
$ . /etc/os-release
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
$ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/Release.key | sudo apt-key add -
$ sudo apt-get -y update
$ sudo apt-get -y install skopeo
Otherwise, read on for building and installing it from source:
To build the skopeo
binary you need at least Go 1.12.
There are two ways to build skopeo: in a container, or locally without a container. Choose the one which better matches your needs and environment.
Building without a container requires a bit more manual work and setup in your environment, but it is more flexible:
- It should work in more environments (e.g. for native macOS builds)
- It does not require root privileges (after dependencies are installed)
- It is faster, therefore more convenient for developing
skopeo
.
Install the necessary dependencies:
# Fedora:
$ sudo dnf install gpgme-devel libassuan-devel btrfs-progs-devel device-mapper-devel
# Ubuntu (`libbtrfs-dev` requires Ubuntu 18.10 and above):
$ sudo apt install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev
# macOS:
$ brew install gpgme
# openSUSE:
$ sudo zypper install libgpgme-devel device-mapper-devel libbtrfs-devel glib2-devel
Make sure to clone this repository in your GOPATH
- otherwise compilation fails.
$ git clone https://github.com/containers/skopeo $GOPATH/src/github.com/containers/skopeo
$ cd $GOPATH/src/github.com/containers/skopeo && make bin/skopeo
By default the make
command (make all) will build bin/skopeo and the documentation locally.
To build the manual you will need go-md2man.
# Debian:
$ sudo apt-get install go-md2man
# Fedora:
$ sudo dnf install go-md2man
Then
$ make docs
Building in a container is simpler, but more restrictive:
- It requires the
podman
command and the ability to run Linux containers. - The created executable is a Linux executable, and depends on dynamic libraries which may only be available only in a container of a similar Linux distribution.
$ make binary
Finally, after the binary and documentation is built:
$ sudo make install