From c1d694fd77fd7348a3badff97056630b72be2774 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 2 Jun 2022 05:53:57 +0200 Subject: [PATCH] build: add Docker Build overview page Signed-off-by: CrazyMax --- _data/toc.yaml | 2 ++ build/buildx/index.md | 2 +- build/buildx/install.md | 2 +- build/index.md | 51 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 build/index.md diff --git a/_data/toc.yaml b/_data/toc.yaml index 6a64276afb5a..ff684c3c872b 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -1400,6 +1400,8 @@ manuals: - sectiontitle: Docker Build section: + - path: /build/ + title: Overview - sectiontitle: Buildx component section: - path: /build/buildx/ diff --git a/build/buildx/index.md b/build/buildx/index.md index 498483db1205..52f9d339c72a 100644 --- a/build/buildx/index.md +++ b/build/buildx/index.md @@ -1,7 +1,7 @@ --- title: Buildx component description: Working with Docker Buildx -keywords: Docker, Buildx, BuildKit +keywords: build, buildx, buildkit redirect_from: - /buildx/working-with-buildx/ --- diff --git a/build/buildx/install.md b/build/buildx/install.md index 9a64c6c985f2..25eaf9c0c51f 100644 --- a/build/buildx/install.md +++ b/build/buildx/install.md @@ -1,7 +1,7 @@ --- title: Install Docker Buildx description: How to install Docker Buildx -keywords: Docker, Buildx, BuildKit +keywords: build, buildx, buildkit --- ## Docker Desktop diff --git a/build/index.md b/build/index.md new file mode 100644 index 000000000000..c3382182e324 --- /dev/null +++ b/build/index.md @@ -0,0 +1,51 @@ +--- +title: Overview of Docker Build +description: Introduction and overview of Docker Build +keywords: build, buildx, buildkit +--- + +Docker Build is one of the most used features of the Docker Engine - users +ranging from developers, build teams, and release teams all use Docker Build. + +Build uses a [client-server architecture](../get-started/overview.md#docker-architecture) +that includes several tools. The most typical being the use of Docker CLI with +`docker build` command sending requests to the Docker Engine that will run +your build. + +Starting with version 18.09, Docker supports a new backend for executing your +builds that is provided by the [BuildKit](https://github.com/moby/buildkit) +project. The BuildKit backend provides many benefits compared to the old +implementation. As there is a new backend, there is also a new client called [Docker Buildx](buildx/index.md), +available as a CLI plugin that extends the docker command with the full +support of the features provided by BuildKit. + +BuildKit is enabled by default for all users on [Docker Desktop](../desktop/index.md). +If you have installed Docker Desktop, you don't have to manually enable BuildKit. +If you have installed Docker as a [Linux package](../engine/install/index.md), +you can enable BuildKit either by using an environment variable or by making +BuildKit the default setting. + +To set the BuildKit environment variable when running the +[`docker build` command](../engine/reference/commandline/build.md), run: + +```console +$ DOCKER_BUILDKIT=1 docker build . +``` + +To enable BuildKit backend by default, set [daemon configuration](/engine/reference/commandline/dockerd/#daemon-configuration-file) +in `/etc/docker/daemon.json` feature to `true` and restart the daemon. If the +`daemon.json` file doesn't exist, create new file called `daemon.json` and then +add the following to the file: + +```json +{ + "features": { + "buildkit": true + } +} +``` + +If you're using the [`docker buildx build` command](../engine/reference/commandline/buildx_build.md), +BuildKit will always being used regardless of the environment variable or backend +configuration. See [Build with Buildx](buildx/index.md#build-with-buildx) guide +for more details.