1、安装buildkit 客户端,buildkit 服务
下载地址:wget https://github.com/moby/buildkit/releases/download/v0.11.6/buildkit-v0.11.6.linux-amd64.tar.gz
解压复制到/usr/bin
tar -xvf buildkit-v0.11.6.linux-amd64.tar.gz
cp -rp /bin/{buildctl,buildkitd} /usr/bin/
2、安装验证
buildctl --version
buildkitd --version
3、配置systemd服务
cat /usr/lib/systemd/system/buildkitd.service
[Unit]
Description=/usr/bin/buildkitd
ConditionPathExists=/usr/bin/buildkitd
After=containerd.service
[Service]
Type=simple
ExecStart=/usr/bin/buildkitd
User=root
Restart=on-failure
RestartSec=1500ms
[Install]
WantedBy=multi-user.target
4、开机自启动
systemctl daemon-reload && systemctl restart buildkitd && systemctl enable buildkitd
5、检查运行状态
systemctl status buildkitd
6、nerdctl 构建镜像
nerdctl build -t test:latest .
标签:bin,buildkit,nerdctl,systemctl,构建,usr,buildkitd,镜像 From: https://www.cnblogs.com/zbhlinux/p/17541101.html