Chapter 4. Building images

 

This chapter covers

  • Some basics of image creation
  • Manipulating the Docker build cache for fast and reliable builds
  • Configuring timezones as part of an image build
  • Running commands directly on your containers from the host
  • Drilling down into the layers created by an image build
  • Using the more advanced ONBUILD feature when building and using images

To get beyond the basics of using Docker, you’ll want to start creating your own building blocks (images) to pull together in interesting ways. This chapter will cover some of the important parts of image creation, looking at practicalities that you might otherwise stumble over.

4.1. Building images

Although the simplicity of Dockerfiles makes them a powerful time-saving tool, there are some subtleties that can cause confusion. We’ll take you over a few time-saving features and their details, starting with the ADD instruction. Then we’ll cover the Docker build cache, how it can let you down, and how you can manipulate it to your advantage.

Remember to refer to the official Docker documentation for complete Dockerfile instructions at https://docs.docker.com.

Summary

sitemap