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: Allow the use of third party images to build dependencies #245

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

protetore
Copy link
Contributor

@protetore protetore commented Jan 7, 2022

Description

Allow the use of third party images to build dependencies other that lambci images.

Motivation and Context

The current implementation requires docker images that have a worker pointing to /var/task, since it forces the mount point to that location. It prevents the user to user an official image or any other image that does has the working directory in /var/task.

If you try to create a lambda for example, using build_in_docker = true it will fail because the workdir is empty. And if you try to use pip_requirements to install the requirements, it will throw an error saying it couldn't find requirements.txt - because the workdir is not the same as the mount point.

With this change we set the workdir to /var/task in the docker run command, so no matter which image you use, the mount point and the workdir will be the same.

We've been using this change in our company and it works with the the default image and official python images.

It could be a better solution to also allow the user to specify a custom workdir. But this is an easier and safe solution for now.

Breaking Changes

There's no breaking changes. This

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

I've tested the container-image and build-package examples. We also have been using this code to deploy production code in our company. Using both the default images as well as official images.

@antonbabenko antonbabenko changed the title Allow the use of third party images to build dependencies feat: Allow the use of third party images to build dependencies Jan 10, 2022
@antonbabenko antonbabenko merged commit 0a9793e into terraform-aws-modules:master Jan 10, 2022
antonbabenko pushed a commit that referenced this pull request Jan 10, 2022
## [2.31.0](v2.30.0...v2.31.0) (2022-01-10)

### Features

* Allow the use of third party images to build dependencies ([#245](#245)) ([0a9793e](0a9793e))
@antonbabenko
Copy link
Member

This PR is included in version 2.31.0 🎉

@github-actions
Copy link

github-actions bot commented Nov 8, 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 Nov 8, 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.

2 participants