Table of Contents

cri-o

https://cri-o.io/

Install Packages

Install cri-o packages (on Ubuntu 20.04 LTS):

install-cri-o.sh
#!/bin/bash
 
#author:  Thomas Roehm
#version: 1.1
 
export VERSION=1.25
export OS="xUbuntu_20.04"                          #must match os version
 
echo ""
echo "checkout 'https://github.com/cri-o/cri-o/blob/main/install.md#apt-based-operating-systems'"
echo "checkout'https://cri-o.io/'"
echo ""
echo "adding '/debian buster-backports main' repository"
sleep 3
echo ""
echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
apt update
echo ""
echo "installing buster-backports"
sleep 3
echo ""
apt install -y -t buster-backports libseccomp2 || apt update -y -t buster-backports libseccomp2
 
apt-mark unhold cri-o cri-o-runc cri-tools
echo ""
echo "adding required repositories"
echo ""
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list
 
sleep 3
echo "Install repositories"
sleep 3
echo ""
 
mkdir -p /usr/share/keyrings
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/Release.key | apt-key add -
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | apt-key add -
 
sleep 3
echo ""
apt-get update
echo ""
echo "install cri-o, cri-o-runc and cri-tool"
sleep 3
echo ""
apt-get install cri-o cri-o-runc cri-tools
 
apt-mark hold cri-o cri-o-runc cri-tools
systemctl enable crio.service
systemctl start crio.service
echo ""
echo "crio installed"
sleep 3
echo ""
systemctl status crio.service

Commands

crictl info
crictl images
crictl rmi --prune                                                                                     #delete all unused images and containers
crictl ps -q | xargs crictl stop                                                                       #stops all running conatiners
crictl --help
crictl pull image
sudo crictl runp net-pod.json
sudo crictl create nginx.json net-pod.json
sudo crictl ps -a
echo "source <(crictl completion bash)" >> .bashrc                                                     #bash autocompletion
sudo curl -v --unix-socket /var/run/crio/crio.sock http://localhost/info | jq                          #check if running and show e. g. cgroup_driver

config

/etc/crio/crio.conf
/etc/crictl.yaml
/etc/containers/policy.json