怎么关闭 docker buildx?

之前启用 docker buildx 之后,我的 docker build 也变成 docker build 了!!!

可恶,怎么关闭 docker buildx?

╰─➤  docker build  
ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build

执行 docker buildx uninstall 没有效果

╰─➤  docker buildx uninstall                                                                                                                                                                                                                                                                                  130 ↵
╭─pon@admini ~/code/me/github/milvus/build/docker/builder/cpu/ubuntu20.04  ‹master*› 
╰─➤  
╭─pon@admini ~/code/me/github/milvus/build/docker/builder/cpu/ubuntu20.04  ‹master*› 
╰─➤  docker build                                        

ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build

~/.docker/config.json 里面也没有别名

╰─➤  cat ~/.docker/config.json                                                                       1 ↵
{
        "auths": {
                "192.168.31.245:8082": {
                        "auth": "YWRtaW46eWpjeWpj"
                }
        }
}% 
阅读 4.7k
4 个回答
export DOCKER_BUILDKIT=0

再运行:

docker build
docker buildx prune

上面的命令可以彻底移除 docker buildx

root@lsr-refresh:~# docker buildx prune
WARNING! This will remove all dangling build cache. Are you sure you want to continue? [y/N] y
ID                                              RECLAIMABLE     SIZE            LAST ACCESSED
ibazfecui842q6n21gd9gzpli*                      true            181.8kB         4 hours ago
rp4eu6ybftfuifwrs7yj73oyr*                      true    14.39MB         3 hours ago
8ijl9u1uvunjxzpk1v15n1fq6*                      true    0B              4 hours ago
xltkjkcv10p7m98mrpkzvu76j*                      true    741B            4 hours ago
tvk5mkrnm04ju8h4ae6y6ak6l*                      true    606B            3 hours ago
4bxi24qbcce3xoz2rbmexiy6z*                      true    0B              3 hours ago
Total:  14.58MB

我也被这个折腾了好久。

~/.docker/config.json 里清理aliases,就可以了

    "aliases": {
            "builder": "buildx"
    }

如果异常,检查一下Dockerfile,基础镜像与当前架构是否一致。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏