Files
docker_practice/buildx/buildx.md
Kang HuaiShuai e490a9c440 Add Docker Buildx
Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
2019-11-05 21:50:05 +08:00

34 lines
627 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用 Buildx 构建镜像
## 启用 Buildx
`buildx` 命令属于实验特性必须设置环境变量以使用该命令
Linux/macOS
```bash
$ export DOCKER_CLI_EXPERIMENTAL=enabled
```
Windows
```bash
$ set $env:DOCKER_CLI_EXPERIMENTAL=enabled
```
## 使用
你可以直接使用 `docker buildx build` 命令构建镜像
```bash
$ docker buildx build .
[+] Building 8.4s (23/32)
=> ...
```
Buildx 使用 [BuildKit 引擎](buildkit.md) 进行构建支持许多新的功能具体参考 [Buildkit](buildkit.md) 一节
## 官方文档
* https://docs.docker.com/engine/reference/commandline/buildx/