Skip to content

Instantly share code, notes, and snippets.

@mmaous
Created October 31, 2024 09:05
Show Gist options
  • Save mmaous/ea862d56df00b058138d41c34d916c74 to your computer and use it in GitHub Desktop.
Save mmaous/ea862d56df00b058138d41c34d916c74 to your computer and use it in GitHub Desktop.
Installs and configures cri-dockerd with systemd support. Easily customizable for different release versions and architectures.
#!/bin/bash
echo "Creating temporary directory for cri-dockerd..."
mkdir -p /tmp/cri-dockerd
echo "Downloading cri-dockerd binary for ARM64 architecture..."
wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.15/cri-dockerd-0.3.15.arm64.tgz
echo "Extracting cri-dockerd archive..."
tar xvf cri-dockerd-0.3.15.arm64.tgz
echo "Moving cri-dockerd binary to /usr/local/bin/..."
sudo mv ./cri-dockerd/cri-dockerd /usr/local/bin/
echo "Checking cri-dockerd version to confirm installation..."
cri-dockerd --version
echo "Downloading cri-docker service file for systemd..."
wget https://raw.githubusercontent.com/Mirantis/cri-dockerd/master/packaging/systemd/cri-docker.service
echo "Downloading cri-docker socket file for systemd..."
wget https://raw.githubusercontent.com/Mirantis/cri-dockerd/master/packaging/systemd/cri-docker.socket
echo "Moving service and socket files to systemd directory..."
sudo mv cri-docker.socket cri-docker.service /etc/systemd/system/
echo "Updating cri-docker service file to use the correct binary path..."
sudo sed -i -e 's,/usr/bin/cri-dockerd,/usr/local/bin/cri-dockerd,' /etc/systemd/system/cri-docker.service
echo "Reloading systemd to recognize new service configurations..."
sudo systemctl daemon-reload
echo "Enabling cri-docker service and activating the socket..."
sudo systemctl enable cri-docker.service
sudo systemctl enable --now cri-docker.socket
echo "Checking the status of the cri-docker socket..."
sudo systemctl status cri-docker.socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment