docker 交叉编译

  1. 查看存在的builder:~ ~docker buildx ls
  2. 创建一个新的builder:docker buildx create --name mybuilder
  3. 使用新的builder:docker buildx use mybuilder && docker buildx inspect --bootstrap
    docker buildx inspect --bootstrap命令出错:
    Error:error getting credentials - err: exit status 1, out: `Failed to execute child process “dbus-launch” (No such file or directory)
    根据这里提示,安装了两个软件包:
    apt install dbus-x11
    apt install gnupg2 pass
  4. 构建镜像:docker buildx build --platform linux/arm64/v7 -t name:proxy_pool .
    平台可以选择linux/amd64,linux/arm64,linux/arm/v7

参考

  1. Leverage multi-CPU architecture support | Docker Documentation