Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support additional arguments for docker and entrypoint override #366

Merged
merged 5 commits into from
Oct 31, 2022

Conversation

AllanBenson001
Copy link
Contributor

Description

  1. Have added support for additional options to be passed to the docker run command
  2. Have added ability to override the entrypoint in the docker run command

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/* projects
    I'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

@antonbabenko
Copy link
Member

Looks good. Could you please resolve merge conflicts?

@AllanBenson001
Copy link
Contributor Author

Conflicts resolved 👍

@antonbabenko antonbabenko merged commit dc4d000 into terraform-aws-modules:master Oct 31, 2022
antonbabenko pushed a commit that referenced this pull request Oct 31, 2022
## [4.5.0](v4.4.1...v4.5.0) (2022-10-31)

### Features

* Support additional arguments for docker and entrypoint override ([#366](#366)) ([dc4d000](dc4d000))
@antonbabenko
Copy link
Member

This PR is included in version 4.5.0 🎉

@AllanBenson001
Copy link
Contributor Author

Thanks for this @antonbabenko Thanks also for adding the fix to my example.

@github-actions
Copy link

github-actions bot commented Dec 2, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants