Cleanup Dockerfile and convert non-distributable handling to ONBUILD #179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do
Bunch of minor (imo) clean ups to the Dockerfile and scripts/install-non-distributable.sh to start.
Then converts the whole fetching of non-distributable files from at ironlib image build time to
ONBUILD
and thus when consumers build their own images based off of ironlib's image.This looks similar to how we used to do things before except there's better handling for skipping all of it by keeping what we do today of requiring a build-arg to opt in to proprietary deps. The old ONBBUILD setup used to check for presence of the fetcher script to decide to run the fetch. That was annoying because consumers would need a whole Dockerfile/repo setup just to have the script.
How can this change be tested by a PR reviewer?
Build this docker image with/without the args to opt-in to proprietary binaries, there should be no difference between the 2 images. Lets assume you tag it
my-local-ironlib
.Now do the same with/without build using the following Dockerfile:
Running
docker build --build-arg INSTALL_NON_DISTRIBUTABLE=true
will fail and complain about missing AWS creds. Build again with the build-arg and it will complete. Also note that since noARG
is present in this example Dockerfile the secrets do not leak into the final image (verification left up to reader).