NVIDIA / container-canary

A tool for testing and validating container requirements against versioned manifests
Apache License 2.0
237 stars 15 forks source link

avoid unnecessary build context in 'make testprep' #68

Closed jameslamb closed 1 month ago

jameslamb commented 1 month ago

make testprep builds some docker images to be used in this project's tests.

Those images don't need any local files (i.e. their Dockefiles don't contain COPY or ADD statements), so passing in the build context like docker build -f Dockerfile . is unnecessary.

This proposes instead switching them to no-context builds. That makes the builds slightly faster and their intention a bit clearer.

Notes for Reviewers

How I tested this

Ran the following.

make clean testprep

On main:

Sending build context to Docker daemon  770.6kB

On this branch:

Sending build context to Docker daemon  2.048kB

That's not a huge difference, but this change would protect against other files accidentally left lying around in the repo from also being added to that build context unnecessarily.