Skip to content

Instantly share code, notes, and snippets.

@eumel8
Last active August 5, 2025 21:19
Show Gist options
  • Select an option

  • Save eumel8/9aad0a340a0123b0586bf55f4be0eb77 to your computer and use it in GitHub Desktop.

Select an option

Save eumel8/9aad0a340a0123b0586bf55f4be0eb77 to your computer and use it in GitHub Desktop.
Install Nerdctl/Containerd
# https://github.com/containerd/nerdctl/releases/latest
# https://github.com/containerd/nerdctl/blob/main/docs/rootless.md
# https://rootlesscontaine.rs/getting-started/common/
# https://github.com/containernetworking/plugins
VERSION=2.1.3
mkdir nerd
cd nerd
# Download the all-in-one archive
curl -LO https://github.com/containerd/nerdctl/releases/download/v${VERSION}/nerdctl-${VERSION}-linux-amd64.tar.gz
# Extract
tar -xzf nerdctl-${VERSION}-linux-amd64.tar.gz
rm nerdctl-${VERSION}-linux-amd64.tar.gz
cp * ~/bin/
# Install
sudo apt install slirp4netns rootlesskit containerd iptables
# check
containerd-rootless-setuptool.sh check
# setup
containerd-rootless-setuptool.sh install
# install cni
sudo mkdir -p /opt/cni/bin
cd /opt/cni/bin
# Download latest CNI plugins (adjust for latest version if needed)
sudo curl -LO https://github.com/containernetworking/plugins/releases/download/v1.7.1/cni-plugins-linux-amd64-v1.7.1.tgz
# Extract them
sudo tar -xvf cni-plugins-linux-amd64-v1.7.1.tgz
# Clean up
sudo rm cni-plugins-linux-amd64-v1.7.1.tgz
# test
nerdctl run hello-world
# install buildkitd
cd
cd nerd
curl -LO https://github.com/moby/buildkit/releases/download/v0.23.2/buildkit-v0.23.2.linux-amd64.tar.gz
tar xfz buildkit-v0.23.2.linux-amd64.tar.gz
cp bin/* ~/bin/
containerd-rootless-setuptool.sh install-buildkit
# Make a test Dockerfile
echo -e "FROM alpine\nCMD echo Hello from nerdctl" > Dockerfile
# Build it
nerdctl build -t test-image .
# Run it
nerdctl run test-image
# bash completion
nerdctl completion bash | sudo tee /etc/bash_completion.d/nerdctl
@eumel8
Copy link
Author

eumel8 commented Aug 5, 2025

proxy settings in /usr/lib/systemd/system/containerd.service

[Service]
#uncomment to enable the experimental sbservice (sandboxed) version of containerd/cri integration
#Environment="ENABLE_CRI_SANDBOXES=sandboxed"
#Environment="HTTP_PROXY=http://your-proxy:port/"
#Environment="HTTPS_PROXY=http://your-proxy:port/"
#Environment="NO_PROXY=localhost,127.0.0.1,::1"

reload daemon

sudo systemctl daemon-reload
sudo systemctl restart containerd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment