anchore / anchore-engine

A service that analyzes docker images and scans for vulnerabilities
Apache License 2.0
1.58k stars 273 forks source link

Btodhunter/reformat dockerfile #1302

Closed Btodhunter closed 2 years ago

Btodhunter commented 2 years ago

What this PR does / why we need it: The main purpose of the PR is to clean up our Dockerfile to make it easier to read. It also has some changes to the ordering and creation of layers to optimize build caching when building the image locally.

By moving our COPY commands directly above the layers that are affected by changes to the local filesystem, we can utilize build caching to speed up image builds during development.

In the final stage, by consolidating to a single layer instead of multiple layers we can reduce the image size.

Vijay-P commented 2 years ago

This LGTM, but let's chat about the freshclam file if you have some time.