<commit_before>---
title: Working with Docker Buildx (experimental)
description: Working with Docker Buildx
keywords: Docker, buildx, multi-arch
---

> **Note:** Docker Buildx is an experimental feature.
>
> {% include experimental-feature.md %}

## Overview

Docker Buildx is a CLI plugin that extends the docker build command with the full support of the features provided by [Moby BuildKit](https://github.com/moby/buildkit) builder toolkit. It provides the same user experience as docker build with many new features like creating scoped builder instances and building against multiple nodes concurrently.

## Install

You must use Docker 19.03.0 beta or a higher version to use `buildx` as a Docker CLI plugin.

You can download the latest binary release from the [Docker buildx releases](https://github.com/docker/buildx/releases/latest) repository. Name the file as `docker-buildx` and then copy  to `~/.docker/cli-plugins` directory.

```
$ export DOCKER_BUILDKIT=1
$ docker build --platform=local -o . git://github.com/docker/buildx
$ mv buildx ~/.docker/cli-plugins/docker-buildx
```

### Docker Desktop (Edge)

`buildx` is bundled with Docker Desktop Edge version 2.0.4.0 or higher. For more information, see https://docs.docker.com/docker-for-mac/edge-release-notes/

### Docker CE nightly builds

`buildx` is also included with the Docker CE nightly builds.

- Mac: [CE nightly](https://download.docker.com/mac/static/nightly/)
- Linux:

```bash
$ # uncomment next line to uninstall previous Docker CE installation if present
$ # apt purge docker-ce docker-ce-cli
$ curl -fsSL https://get.docker.com/ -o docker-install.sh
$ CHANNEL=nightly sh docker-install.sh
```

After installation, you can access Buildx using the `docker buildx` command.

## Build with `buildx`

To start a new build, run the command `docker buildx build .`

```
$ docker buildx build .
[+] Building 8.4s (23/32)
 => ...
 ```

Buildx builds using the BuildKit engine and does not require `DOCKER_BUILDKIT=1` environment variable to start the builds.

The `buildx build` command supports features available for `docker build`, including the new features in Docker 19.03 such as outputs configuration, inline build caching, and specifying target platform. In addition, Buildx also supports new features that are not yet available for regular `docker build` like building manifest lists, distributed caching, and exporting build results to OCI image tarballs.

You can run Buildx in different configurations that are exposed through a driver concept. Currently, Docker supports a "docker" driver that uses the BuildKit library bundled into the docker daemon binary, and a "docker-container" driver that automatically launches BuildKit inside a Docker container.

The user experience of using Buildx is very similar across drivers. However, there are some features that are not currently supported by the "docker" driver, because the BuildKit library which is bundled into docker daemon uses a different storage component. In contrast, all images built with the "docker" driver are automatically added to the "docker images" view by default, whereas when using other drivers, the method for outputting an image needs to be selected with `--output`.

## Work with builder instances<commit_msg>Fix tech review comments<commit_after>---
title: Working with Docker Buildx (experimental)
description: Working with Docker Buildx
keywords: Docker, buildx, multi-arch
---

> **Note:** Docker Buildx is an experimental feature.
>
> {% include experimental.md %}

## Overview

Docker Buildx is a CLI plugin that extends the docker command with the full support of the features provided by [Moby BuildKit](https://github.com/moby/buildkit) builder toolkit. It provides the same user experience as docker build with many new features like creating scoped builder instances and building against multiple nodes concurrently.

## Install

Docker Buildx is included in Docker 19.03 and is also bundled with the following Docker Desktop releases. Note that you must enable the 'Experimental features' option to use Docker Buildx.

- Docker Desktop Enterprise version 2.1.0
- Docker Desktop Edge version 2.0.4.0 or higher

You can also download the latest `buildx` binary from the [Docker buildx](https://github.com/docker/buildx/) repository.

## Build with `buildx`

To start a new build, run the command `docker buildx build .`

```
$ docker buildx build .
[+] Building 8.4s (23/32)
 => ...
 ```

Buildx builds using the BuildKit engine and does not require `DOCKER_BUILDKIT=1` environment variable to start the builds.

The `docker buildx build` command supports features available for `docker build`, including the new features in Docker 19.03 such as outputs configuration, inline build caching, and specifying target platform. In addition, Buildx also supports new features that are not yet available for regular `docker build` like building manifest lists, distributed caching, and exporting build results to OCI image tarballs.

You can run Buildx in different configurations that are exposed through a driver concept. Currently, Docker supports a "docker" driver that uses the BuildKit library bundled into the docker daemon binary, and a "docker-container" driver that automatically launches BuildKit inside a Docker container.

The user experience of using Buildx is very similar across drivers. However, there are some features that are not currently supported by the "docker" driver, because the BuildKit library which is bundled into docker daemon uses a different storage component. In contrast, all images built with the "docker" driver are automatically added to the "docker images" view by default, whereas when using other drivers, the method for outputting an image needs to be selected with `--output`.

## Work with builder instances
{'fraction_non_alphanumeric': 0.07028699089190582, 'fraction_numerical': 0.007389585839491322, 'mean_word_length': 4.66699123661149, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5190259', 'n_tokens_mistral': 1548, 'n_tokens_neox': 1408, 'n_words': 769}