Mirantis / cri-dockerd

dockerd as a compliant Container Runtime Interface for Kubernetes
https://mirantis.github.io/cri-dockerd/
Apache License 2.0
1.13k stars 294 forks source link

when cri-dockerd can support Red Hat Enterprise Linux centos 9, which kernel version is 5.14.0-362.8.1.el9_3.x86_64 #368

Open legendyman opened 6 months ago

legendyman commented 6 months ago

Expected Behavior

when I install cri-dockerd on centos 9, cause a error :

image

Actual Behavior

Steps to Reproduce the Problem

  1. key input command : yum -y install cri-dockerd-0.3.14-3.el8.x86_64.rpm
  2. then cause a error : behand picture

image

  1. try install libcgroup: yum -y install libcgroup, then error image
  2. use command uname -a, image found the version of kernel is 5.14.0-362.8.1.el9_3.x86_64 5、however, the version of cri-dockerd is 0.3.14-3.el8.x86_64 or 0.3.14-3.el7.x86_64

    Specifications

    • Version:
    • Platform:
    • Subsystem:
afbjorklund commented 6 months ago

The libcgroup library has been removed from EL9, so it needs a new RPM package for cri-dockerd.

Only libcgroup-0.41-21.el7.x86_64.rpm or libcgroup-0.41-19.el8.x86_64.rpm are available in CentOS

afbjorklund commented 6 months ago

Not sure why this is copy/paste from docker-ce to cri-dockerd, but needs to be updated here too:

https://github.com/docker/docker-ce-packaging/commit/0b469b4cc53f642716a98639f20f463ced00a818 # Libcgroup is no longer available in RHEL/CentOS >= 9 distros.

j796160836 commented 1 month ago

Here is manually install instructions for search engine newbie like me. I put some breadcrumbs and let newbie to follow.

Tested in RHEL 9.4.

Instructions

Install Golang

Redhat's yum repository doesn't have newer Golang above 1.22.0. (only have 1.21.13). So you also need to install Golang manually. 🥲

Browse to Golang official website. to download latest version of Golang (e.g. 1.23.2) https://go.dev/dl/

  1. Download it.
$ wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
  1. Untar the files and move to proper positions
$ tar zxvf go1.23.2.linux-amd64.tar.gz
sudo mv go /usr/lib/golang
  1. Symlink the executables.
$ sudo ln -s /usr/lib/golang/bin/go /usr/bin/go
  1. Verify Golang version
$ go version
go version go1.23.2 linux/amd64

Install cri-dockerd

  1. Install proper package
$ yum install -y git make
  1. Git clone latest version
$ git clone https://github.com/Mirantis/cri-dockerd.git
  1. Compile it
$ cd cri-dockerd && \
make cri-dockerd
Install it
cd cri-dockerd && \
mkdir -p /usr/local/bin && \
install -o root -g root -m 0755 cri-dockerd /usr/local/bin/cri-dockerd && \
install packaging/systemd/* /etc/systemd/system && \
sed -i -e 's,/usr/bin/cri-dockerd,/usr/local/bin/cri-dockerd,' /etc/systemd/system/cri-docker.service
  1. Reload the daemon and enable services
$ sudo systemctl daemon-reload && \
sudo systemctl enable --now cri-docker

You may need to restart services after install if updates cri-docker.

sudo systemctl daemon-reload && \
sudo systemctl restart cri-docker
  1. How to verify?

Check the cri-docker services.

$ systemctl status cri-docker

Verify cri-dockerd version.

$ cri-dockerd --version
cri-dockerd 0.3.12-16-gebd9de06 (ebd9de06)

Reference

https://mirantis.github.io/cri-dockerd/usage/install-manually/

afbjorklund commented 1 month ago

You might want to file another issue about improving "building from source", this issue was about the packages.