feat: Support additional arguments for docker and entrypoint override #366
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.
Description
This PR replaces #360. The approach here requires fewer changes to package.py, making it far easier to maintain going forwards.
Motivation and Context
I want to build my lambdas in docker containers (because my build environment might not have the required pre-requisites installed) but I need access to packages in CodeArtifact. Differences in build environments make this slightly more difficult. On build machines builds are run within containers, so I have Docker in Docker issues. On developers machines, Terraform might be running within a container or it might not. Workarounds to cope with these different environments make for some very ugly code.
Therefore, the best option is to make these changes that allow me to pass AWS tokens in as environment variables and run a CodeArtifact login within the container (via the entrypoint) before doing a pip install. I see the need to be able to do things like pass tokens as environment variables or map local config files as volumes as being quite a common scenario for people wanting to get packages from private repositories (e.g. Artifactory), that's why I'm updating this module.
Breaking Changes
None
How Has This Been Tested?
I have updated at least one of the
examples/*
to demonstrate and validate my change(s)I have tested and validated these changes using one or more of the provided
examples/*
projectsI've run existing examples under examples/build-package and have added a new example to show how the new feature can be used
I have executed
pre-commit run -a
on my pull request