cri-o

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
docker/cri-o.txt · Last modified: 2024/10/01 16:00 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki