docker buildx

https://docs.docker.com/buildx/working-with-buildx/

https://juejin.cn/post/6844904008801320967

export DOCKER_CLI_EXPERIMENTAL=enabled
export DOCKER_BUILDKIT=1
wget https://github.com/docker/buildx/releases/download/v0.7.0/buildx-v0.7.0.linux-amd64
chmod +x buildx-v0.7.0.linux-amd64
mkdir -p ~/.docker/cli-plugins/
mv buildx-v0.7.0.linux-amd64 ~/.docker/cli-plugins/docker-buildx

docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --use --name mybuilder
docker buildx inspect mybuilder --bootstrap
docker buildx ls
# 镜像名就看自己的需要,然后推送上去就行了,一个镜像名有多个镜像
docker buildx build -t hank997/book:v3 --platform=linux/arm,linux/arm64,linux/amd64 . --push
# 单独把镜像推送到docker image ls 可以查看
docker buildx build -t hank997/book:v3 --platform=linux/arm -o type=docker .
docker buildx imagetools inspect hank997/book:v3
posted @ 2021-11-25 11:07  汉克书  阅读(190)  评论(0编辑  收藏  举报