Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/buildx redirect #14092

Merged
merged 2 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 53 additions & 11 deletions buildx/working-with-buildx.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,66 @@ multiple nodes concurrently.

## Install

Docker Buildx is included in Docker Desktop and Docker Linux packages when
installed using the [DEB or RPM packages](../engine/install/index.md).
### Windows and macOS

You can also download the latest `buildx` binary from the
[Docker buildx](https://github.com/docker/buildx/releases/latest){:target="_blank" rel="noopener" class="_"} releases page
on GitHub, copy it to `~/.docker/cli-plugins` folder with name
`docker-buildx` and change the permission to execute:
Docker Buildx is included in [Docker Desktop](../desktop/index.md) for Windows
and macOS.

```console
$ chmod a+x ~/.docker/cli-plugins/docker-buildx
```
### Linux packages

Docker Linux packages also include Docker Buildx when installed using the
[DEB or RPM packages](../engine/install/index.md).

### Manual download

> **Important**
>
> This section is for unattended installation of the buildx component. These
> instructions are mostly suitable for testing purposes. We do not recommend
> installing buildx using manual download in production environments as they
> will not be updated automatically with security updates.
>
> On Windows and macOS, we recommend that you install [Docker Desktop](../desktop/index.md)
> instead. For Linux, we recommend that you follow the [instructions specific for your distribution](#linux-packages).
{: .important}

You can also download the latest binary from the [releases page on GitHub](https://github.com/docker/buildx/releases/latest){:target="_blank" rel="noopener" class="_"}.

Rename the relevant binary and copy it to the destination matching your OS:

| OS | Binary name | Destination folder |
| -------- | -------------------- | -----------------------------------------|
| Linux | `docker-buildx` | `$HOME/.docker/cli-plugins` |
| macOS | `docker-buildx` | `$HOME/.docker/cli-plugins` |
| Windows | `docker-buildx.exe` | `%USERPROFILE%\.docker\cli-plugin` |

Or copy it into one of these folders for installing it system-wide.

On Unix environments:

* `/usr/local/lib/docker/cli-plugins` OR `/usr/local/libexec/docker/cli-plugins`
* `/usr/lib/docker/cli-plugins` OR `/usr/libexec/docker/cli-plugins`

On Windows:

* `C:\ProgramData\Docker\cli-plugins`
* `C:\Program Files\Docker\cli-plugins`

> **Note**
>
> On Unix environments, it may also be necessary to make it executable with `chmod +x`:
> ```shell
> $ chmod +x ~/.docker/cli-plugins/docker-buildx
> ```

### Dockerfile

Here is how to use buildx inside a Dockerfile through the
Here is how to install and use Buildx inside a Dockerfile through the
[`docker/buildx-bin`](https://hub.docker.com/r/docker/buildx-bin) image:

```dockerfile
FROM docker
COPY --from=docker/buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx
COPY --from=docker/buildx-bin:latest /buildx /usr/libexec/docker/cli-plugins/docker-buildx
RUN docker buildx version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this (and other instructions) include a docker buildx install step, and a way to verify that docker buildx install correctly replaced docker build to be backed by buildx?

Copy link
Member Author

@crazy-max crazy-max Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a dedicated section below that talks about it Set buildx as the default builder. We might update it when docker/cli#3314 is merged/released though.

```

Expand Down
6 changes: 6 additions & 0 deletions go/buildx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: How to install Buildx
description: Instructions on installing Buildx
keywords: Docker, buildx, multi-arch
redirect_to: /buildx/working-with-buildx/#install
---