containerd is an industry-standard container runtime with an emphasis
on simplicity, robustness and portability [1]. In this tutorial we are going to build and execute it on Power.
Before we get started building it, we need to get a Power VM. Ask for a FREE account at http://openpower.ic.unicamp.br/minicloud/. Once you get it, you can start start following this steps, which were tested on Ubuntu 18.04.
Building containerd requires GO >= 1.10.x, protoc (protocolo buffers) 3.x compiler and headers, btrfs headers and libraries and libseccomp.
1. Install the required dependencies
# install required dependencies export DEBIAN_FRONTEND=noninteractive apt-get update -y apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade -yq apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -yq build-essential btrfs-tools libseccomp-dev unzip pkg-config
2. Configure your GO development environment
git clone https://github.com/rpsene/goconfig.git source ./goconfig/go.sh install cd
3. Install protoc
Protocol Buffers (a.k.a., protobuf) are Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data.
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-ppcle_64.zip unzip ./protoc-3.7.1-linux-ppcle_64.zip -d protoc-3.7.1 mv ./protoc-3.7.1/bin/protoc /usr/local/bin
4. Build and install runc
runc is the default container runtime used by containerd and is required to run containerd
go get github.com/opencontainers/runc cd $GOPATH/src/github.com/opencontainers/runc make make install
5. Build and install containerd
# build containerid go get github.com/containerd/containerd cd $GOPATH/src/github.com/containerd/containerd make make install make integration
6. Configure containerd as a service
cp ./containerd.service /etc/systemd/system/ chmod 700 /etc/systemd/system/containerd.service systemctl enable containerd.service service containerd start service containerd status containerd config default > /etc/containerd/config.toml
7. Run a validation test
Use the sample located at https://github.com/rpsene/containerd-ppc64le/blob/master/ubunu.sh#L64-L158
8. References
[1] – https://containerd.io/