Skip to content

Commit fd22746

Browse files
thaJeztahcrazy-max
authored andcommitted
Update deprecation docs
- expand a bit on what's happening - clarify start of deprecation of the classic builder - show examples of error and warning Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent bce65f0 commit fd22746

1 file changed

Lines changed: 71 additions & 8 deletions

File tree

docs/deprecated.md

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The table below provides an overview of the current status of deprecated feature
5050

5151
Status | Feature | Deprecated | Remove
5252
-----------|------------------------------------------------------------------------------------------------------------------------------------|------------|------------
53+
Deprecated | [Legacy builder for Linux images](#legacy-builder-for-linux-images) | v21.xx | -
5354
Deprecated | [Legacy builder fallback](#legacy-builder-fallback) | v21.xx | -
5455
Removed | [Support for encrypted TLS private keys](#support-for-encrypted-tls-private-keys) | v20.10 | v21.xx
5556
Deprecated | [Kubernetes stack and context support](#kubernetes-stack-and-context-support) | v20.10 | -
@@ -100,20 +101,82 @@ Removed | [`--api-enable-cors` flag on `dockerd`](#--api-enable-cors-flag-on-
100101
Removed | [`--run` flag on `docker commit`](#--run-flag-on-docker-commit) | v0.10 | v1.13
101102
Removed | [Three arguments form in `docker import`](#three-arguments-form-in-docker-import) | v0.6.7 | v1.12
102103

104+
### Legacy builder for Linux images
105+
106+
**Deprecated in Release: v21.xx**
107+
108+
Docker v21.xx now uses BuildKit by default to build Linux images, and uses the
109+
[Buildx](https://docs.docker.com/buildx/working-with-buildx/) CLI component for
110+
`docker build`. With this change, `docker build` now exposes all advanced features
111+
that BuildKit provides and which were previously only available through the
112+
`docker buildx` subcommands.
113+
114+
The Buildx component is installed automatically when installing the `docker` CLI
115+
using our `.deb` or `.rpm` packages, and statically linked binaries are provided
116+
both on `download.docker.com`, and through the [`docker/buildx-bin` image](https://hub.docker.com/r/docker/buildx-bin)
117+
on Docker Hub. Refer the [Buildx section](http://docs.docker.com/go/buildx/) for
118+
detailed instructions on installing the Buildx component.
119+
120+
This release marks the beginning of the deprecation cycle of the classic ("legacy")
121+
builder for Linux images. No active development will happen on the classic builder
122+
(except for bugfixes). BuildKit development started five Years ago, left the
123+
"experimental" phase since Docker 18.09, and is already the default builder for
124+
[Docker Desktop](https://docs.docker.com/desktop/mac/release-notes/3.x/#docker-desktop-320).
125+
While we're comfortable that BuildKit is stable for general use, there may be
126+
some changes in behavior. If you encounter issues with BuildKit, we encourage
127+
you to report issues in the [BuildKit issue tracker on GitHub](https://github.com/moby/buildkit/){:target="_blank" rel="noopener" class="_"}
128+
129+
> Classic builder for building Windows images
130+
>
131+
> BuildKit does not (yet) provide support for building Windows images, and
132+
> `docker build` continues to use the classic builder to build native Windows
133+
> images on Windows daemons.
134+
103135
### Legacy builder fallback
104136

105137
**Deprecated in Release: v21.xx**
106138

107-
BuildKit implementation code and linked build flags have been removed in the CLI
108-
and are now forwarded to [Buildx](https://docs.docker.com/buildx/working-with-buildx/)
109-
builder component.
139+
[Docker v21.xx now uses BuildKit by default to build Linux images](#legacy-builder-for-linux-images),
140+
which requires the Buildx component to build images with BuildKit. There may be
141+
situations where the Buildx component is not available, and BuildKit cannot be
142+
used.
143+
144+
To provide a smooth transition to BuildKit as the default builder, Docker v21.xx
145+
has an automatic fallback for some situations, or produces an error to assist
146+
users to resolve the problem.
147+
148+
In situations where the user did not explicitly opt-in to use BuildKit (i.e.,
149+
`DOCKER_BUILDKIT=1` is not set), the CLI automatically falls back to the classic
150+
builder, but prints a deprecation warning:
151+
152+
```
153+
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
154+
Install the buildx component to build images with BuildKit:
155+
https://docs.docker.com/go/buildx/
156+
```
157+
158+
This situation may occur if the `docker` CLI is installed using the static binaries,
159+
and the Buildx component is not installed or not installed correctly. This fallback
160+
will be removed in a future release, therefore we recommend to [install the Buildx component](https://docs.docker.com/go/buildx/)
161+
and use BuildKit for your builds, or opt-out of using BuildKit with `DOCKER_BUILDKIT=0`.
162+
163+
If you opted-in to use BuildKit (`DOCKER_BUILDKIT=1`), but the Buildx component
164+
is missing, an error is printed instead, and the `docker build` command fails:
165+
166+
```
167+
ERROR: BuildKit is enabled but the buildx component is missing or broken.
168+
Install the buildx component to build images with BuildKit:
169+
https://docs.docker.com/go/buildx/
170+
```
110171

111-
If Buildx plugin is missing or broken, build command will fall back to the
112-
legacy builder. This fallback mechanism will be removed in a future release and
113-
user prompted to install the Buildx plugin.
172+
We recommend to [install the Buildx component](https://docs.docker.com/go/buildx/)
173+
to continue using BuildKit for your builds, but alternatively, users can either
174+
unset the `DOCKER_BUILDKIT` environment variable to fall back to the legacy builder,
175+
or opt-out of using BuildKit with `DOCKER_BUILDKIT=0`.
114176

115-
User can always fall back to the legacy builder with `DOCKER_BUILDKIT=0` but
116-
`DOCKER_BUILDKIT=1` will always require Buildx.
177+
Be aware that the [classic builder is deprecated](#legacy-builder-for-linux-images)
178+
so both the automatic fallback and opting-out of using BuildKit will no longer
179+
be possible in a future release.
117180

118181
### Support for encrypted TLS private keys
119182

0 commit comments

Comments
 (0)