Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 632 Bytes

README.md

File metadata and controls

21 lines (13 loc) · 632 Bytes

Docker Multistage Cache Example

This is an example Django project to illustrate the usage of building intermediate stages and leveraging their built image for caching.

Prerequisites

  • Docker installed.

Usage

  • Build the intermediate dependency stages into separate images with --target being the stage's name and a -t tag that you could later identify it with. I.e:

    docker build --target=dependencies -t django_example:dep .
  • Build the final image use --cache-from listing the intermediate image. I.e:

    docker build --cache-from django_example:dep -t django_example:final .