How to install containerd on Raspberry Pi
You need to be running at least Raspbian OS with Buster or Raspberry Pi OS (might work with older OS versions too, but I haven’t tested it).
I’ve also updated the system, firmware, apps, etc to the latest version:
sudo apt update
sudo apt full-upgrade
sudo rpi-updateInstall Go
We need Go to install runc and containerd.
Download the Go archive (check downloads for other distributions):
wget https://golang.org/dl/go1.15.6.linux-armv6l.tar.gzExtract the archive to /usr/local:
tar -C /usr/local -xzf go1.15.6.linux-armv6l.tar.gzAdd the binary to PATH (in ~/.profile or ~/.bash_profile):
echo 'PATH="$PATH:/usr/local/go/bin"' | tee -a $HOME/.profileSet the GOPATH (get it from go env GOPATH):
echo "export GOPATH=$(go env GOPATH)" | tee -a $HOME/.profileReload the shell and verify the installation:
source $HOME/.profile
go version
# go version go1.15.6 linux/armInstall runc
We need runc to spawn and run containers.
Install libseccomp-dev for seccomp support:
sudo apt install libseccomp libseccomp-devgo get -v github.com/opencontainers/runc
cd $GOPATH/src/github.com/opencontainers/runc
make -j`nproc`
sudo env PATH="$PATH" make installInstall containerd
Install btrfs libs and tools:
sudo apt install btrfs-progs libbtrfs-devInstall the tools we need to build protobuf (we assume make, g++, curl and unzip are already installed):
sudo apt install autoconf automake libtoolInstall protobuf (if g++ dies or ld errors, lower the cpu cores used, e.g -j3, -j2, -j1 and/or enable overclocking and increase swap):
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout v3.14.0
git submodule update --init --recursive
./autogen.sh
./configure
make -j2
make -l2 -j2 check
sudo make install
sudo ldconfigIoTest.LargeOutput test fails, it’s probably just due to the lack of memory.go get -v github.com/containerd/containerd
cd $GOPATH/src/github.com/containerd/containerd
make -j2
sudo env PATH="$PATH" make installVerify the installation:
containerd --version
# containerd github.com/containerd/containerd v1.4.0-2397-ge98d7f8ea e98d7f8eaafce9da741ef37c7fedcde571806dcbRun containerd as a systemd service:
cd $GOPATH/src/github.com/containerd/containerd
sudo cp containerd.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable containerd.service
sudo systemctl start containerd.serviceThat’s it, containerd should be up and running.
To test it, follow the getting started guide, or follow the simple guide from rolandjitsu/containerd-oci-import (illustrates how to use local OCI images too).