Overview of Docker Build

Overview

Docker Build is one of Docker Engine’s most used features. Whenever you are creating an image you are using Docker Build. Build is a key part of your software development life cycle allowing you to package and bundle your code and ship it anywhere.

Engine uses a client-server architecture and is composed of multiple components and tools. The most common method of executing a build is by issuing a docker build command. The CLI sends the request to Docker Engine which, in turn, executes your build.

There are now two components in Engine that can be used to build an image. Starting with the 18.09 release, Engine is shipped with Moby BuildKit, the new component for executing your builds by default.

The new client Docker Buildx, is a CLI plugin that extends the docker command with the full support of the features provided by BuildKit builder toolkit. docker buildx build command provides the same user experience as docker build with many new features like creating scoped builder instances, building against multiple nodes concurrently, 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.

Docker Build is way more than a simple build command and is not only about packaging your code, it’s a whole ecosystem of tools and features that support not only common workflow tasks but also provides support for more complex and advanced scenarios.

Packaging your software

Build and package your application to run it anywhere: locally or in the cloud.

Multi-stage builds

Keep your images small and secure with minimal dependencies.

Multi-platform images

Build, push, pull, and run images seamlessly on different computer architectures.

Build drivers

Configure where and how you run your builds.

Build caching

Avoid unnecessary repetitions of costly operations, such as package installs.

Continuous integration

Learn how to use Docker in your continuous integration pipelines.

Exporters

Export any artifact you like, not just Docker images.

Bake

Orchestrate your builds with Bake.

Dockerfile frontend

Learn about the Dockerfile frontend for BuildKit.

Configure BuildKit

Take a deep dive into the internals of BuildKit to get the most out of your builds.