Nerdctl
使用 Nerdctl 构建多架构镜像
· ☕ 2 分钟
1. Nerdctl 安装 安装 Opscli 1 curl -sfL https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh |VERSION=latest sh - 安装 Nerdctl 1 opscli task -f install-nerdctl --arch amd64 2. BuildKit 下载 Buildkit 1 wget https://github.com/moby/buildkit/releases/download/v0.19.0-rc2/buildkit-v0.19.0-rc2.linux-amd64.tar.gz 安装 Buildkit 1 2 tar xvf buildkit-*.tar.gz mv bin/* /usr/local/bin/ 配置 Buildkitd 1 mkdir -p /etc/buildkit /data/buildkit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 cat > /etc/buildkit/buildkitd.toml <<EOF debug = true root = "/data/buildkit" [worker.oci] enabled = false [worker.containerd] address = "/run/containerd/containerd.sock" enabled = true platforms = [ "linux/amd64", "linux/arm64" ] namespace = "buildkit" gc = true gckeepstorage = 9000 cniPoolSize = 16 EOF 生成 Systemd Unit 文件 1 2 3 4 5 6 7 8