背景
几年前折腾过 多架构构建的 buildx 一直用着很顺畅,这2天构建镜像,总是遇到这个 error: no active session for ***: context deadline exceeded报错
查了下,可能和 buildx 版本有关,希望升级能解决。
升级步骤
当然是 直接更新 buildx 的最新版本, https://github.com/docker/buildx/releases
|
1 2 3 4 5 6 7 8 9 10 11 12 |
# 下载并更新 wget -c https://github.com/docker/buildx/releases/download/v0.31.1/buildx-v0.31.1.linux-amd64 -O /root/buildx031 chmod +x /root/buildx031 cp /root/buildx031 /usr/libexec/docker/cli-plugins/docker-buildx cp: overwrite ‘/usr/libexec/docker/cli-plugins/docker-buildx’? yes # 检查下版本 docker buildx version github.com/docker/buildx v0.31.1 a2675950d46b2cb171b23c2015ca44fb88607531 # 完整路径检查 /usr/libexec/docker/cli-plugins/docker-buildx version github.com/docker/buildx v0.31.1 a2675950d46b2cb171b23c2015ca44fb88607531 |
更新后,继续构建,遇到 api 兼容报错
docker buildx build --platform linux/amd64,linux/arm64 -t cnrock/moltbot:v1 . --push 2>&1 |tee /tmp/bot.log ERROR: failed to build: Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.43: driver not connecting
意思就是
buildx v0.31.1 使用了API 1.52,而我当前环境的Docker 24.0.6支持的最高API版本是1.43
按提示更新 docker 呗。
yum update 遇到报错了,原因是 vps是甲骨文的,系统是 20年6月的 Oracle Linux Server 7.9
7.9 停更很久了,无法直接更新,提示yum-tokyo... 这里 repo 404
发现这里是一个地区变量,sed 全部替换掉
sudo sed -i 's/\$ociregion//g' /etc/yum.repos.d/*.repo
再 yum makecache 即可
升级命令
|
1 |
yum update docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
升级前后版本对比
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Resolving Dependencies --> Running transaction check ---> Package containerd.io.x86_64 0:1.6.24-3.1.el7 will be updated ---> Package containerd.io.x86_64 0:1.6.33-3.1.el7 will be an update ---> Package docker-buildx-plugin.x86_64 0:0.11.2-1.el7 will be updated ---> Package docker-buildx-plugin.x86_64 0:0.14.1-1.el7 will be an update ---> Package docker-ce.x86_64 3:24.0.6-1.el7 will be updated ---> Package docker-ce.x86_64 3:26.1.4-1.el7 will be an update ---> Package docker-ce-cli.x86_64 1:24.0.6-1.el7 will be updated ---> Package docker-ce-cli.x86_64 1:26.1.4-1.el7 will be an update ---> Package docker-compose-plugin.x86_64 0:2.21.0-1.el7 will be updated ---> Package docker-compose-plugin.x86_64 0:2.27.1-1.el7 will be an update --> Finished Dependency Resolution |
但这样升级会把 buildx 回退,这2个逻辑有点神奇
docker buildx version
github.com/docker/buildx v0.14.1 59582a8
/usr/libexec/docker/cli-plugins/docker-buildx version
github.com/docker/buildx v0.14.1 59582a8
需要再次更新下
|
1 2 3 4 5 6 7 8 9 10 11 12 |
# 下载并更新 wget -c https://github.com/docker/buildx/releases/download/v0.31.1/buildx-v0.31.1.linux-amd64 -O /root/buildx031 chmod +x /root/buildx031 cp /root/buildx031 /usr/libexec/docker/cli-plugins/docker-buildx cp: overwrite ‘/usr/libexec/docker/cli-plugins/docker-buildx’? yes # 检查下版本 docker buildx version github.com/docker/buildx v0.31.1 a2675950d46b2cb171b23c2015ca44fb88607531 # 完整路径检查 /usr/libexec/docker/cli-plugins/docker-buildx version github.com/docker/buildx v0.31.1 a2675950d46b2cb171b23c2015ca44fb88607531 |
尾声
构建镜像 还是遇到这个报错,无解了?
|
1 |
ERROR: failed to build: failed to solve: DeadlineExceeded: failed to push cnrock/openclaw:v1: no active session for x8821klxrbc7g2j3s94ryho4o: context deadline exceeded |
清理下缓存看看
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
docker builder prune -af && docker buildx prune -af ID RECLAIMABLE SIZE LAST ACCESSED gedc44uv09brh7k1b5ihcdv7a* true 146.4MB fyfv6pxd2nu9a7a3rpwbct2je true 0B 1 second ago opkb996ch7wdzq5ri28aea96h true 88.16MB 5 seconds ago zm924nzc6kf6m6dr2l6t04p1t true 68.4MB 5 seconds ago n1mq6swjl2yieubbye1e1dyjg true 0B Less than a second ago wjq8a2e7003ixvqulmwj7w8a5 true 3.144kB Less than a second ago wibxmwpekzhzdgf59ltjl7djp true 2.477GB 59 seconds ago s2r9rasg75rai76vq1yr57p0h true 107.3MB 6 seconds ago 8rbg7n8bi8djgd7v4zu274du8 true 746.5MB 23 seconds ago c84xzuc4cedx9s3wnxuh4ct57 true 0B Less than a second ago qbydufcgecvlvff383ptec4ib true 0B 4 seconds ago Total: 3.634GB ID RECLAIMABLE SIZE LAST ACCESSED ginvvjcmeqo9d1ywai7uniy57 true 17.03MB 8 minutes ago bfi3nue5fcy98bllqfpjhrnf5* true 4.096kB 8 minutes ago xvczyifbxfyt93g3e8wn0hpra true 43.38MB 8 minutes ago y8or8ryz0k0hlbzsqtygsz31f true 2.178GB 8 minutes ago frhx3okb3yt3a1cx15rh8doij true 522.1kB 8 minutes ago jkotdgurx7vjieksh6i8cuedo true 151B 45 minutes ago jjntlo74l3ytwnjkfbv469419 true 4.511kB 45 minutes ago d5h9j2mstr65h10xp6yjg2nzw true 532.6kB 45 minutes ago jt54eop4mla5fwsu8cpomzwcx true 32B 45 minutes ago ccbgzfwlhfk7effg93tm0hacu true 93B 45 minutes ago nsbm1mp4pscqk3c5csmz4fjar true 196.7kB 45 minutes ago belnpn9x5hragi7njjzru42dd true 4.288kB 45 minutes ago xg5gvoflxc5a051ntlgmiz1rk true 141.8MB 45 minutes ago bp1o42065rtiaptvajozssqtq true 4.542kB 45 minutes ago bd0z536inzhhoa6brnlzq8907 true 6.625MB About an hour ago pyz1arj7tuijmm4hogezi7uqz true 269.1MB About an hour ago 037cgb6u7x0mq7dkrixlkv0i2 true 60.67kB About an hour ago 5o3epn1zatu8gak8ca3v3nuz6 true 825.9MB About an hour ago lktznd2lmas9mj45sqt1ibfja true 255.7MB About an hour ago w89z0erggtkwthk4q4082m0hj true 75.09MB About an hour ago rbb6wjhfco7eueu0l4g9tw8wp true 179MB About an hour ago Total: 3.993GB |
无解中,放弃buildx 多架构构建了,暂时单独找了amd和arm vps节点真实环境构建后合并。
有空再继续。
文章评论