Build with Docker

Welcome! This guide is an introduction and deep-dive into building software with Docker.

Whether you’re just getting started, or you’re already an advanced Docker user, this guide aims to provide useful pointers into the possibilities and best practices of Docker's build features.

Topics covered in this guide include:

  • Introduction to build concepts
  • Image size optimization
  • Build speed performance improvements
  • Building and exporting binaries
  • Cache mounts and bind mounts
  • Software testing
  • Multi-platform builds

Throughout this guide, an example application written in Go is used to illustrate how the build features work. You don’t need to know the Go programming language to follow this guide.

The guide starts off with a simple Dockerfile example, and builds from there. Some of the later sections in this guide describe advanced concepts and workflows. You don't need to complete this entire guide from start to finish. Follow the sections that seem relevant to you, and save the advanced sections at the end for later, when you need them.