Feature request: Allow makefile BuildMethod to use Amazon Linux 2 based build image
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Describe your idea/feature/enhancement
I'm not sure if this is a bug or a feature request, but when running `sam build --use-container` for a Lambda Layer resource we have encountered a situation where it seems you can only use the `makefile` build method with the `provided` build image (apparently based on Amazon Linux 1) and there seems to be no way to use BuildMethod `makefile` with an image based on Amazon Linux 2 instead.
### Proposal
If this is indeed not possible currently, I would like to see a way to control the image used during build (`provided` or `provided.al2`) when specifying a `makefile` BuildMethod.
I'm not sure if this would require changes to the SAM spec, or could perhaps be solved with a CLI flag/toggle when running `sam build` (or perhaps a setting in `samconfig.toml`)? Alternatively I could see a way of adding a new BuildMethod called `makefile.al2`, but I think a CLI toggle initially should do the trick.
### Additional Details
Our situation is that we are using SAM to build some layers used by Python3.9 lambda runtimes, and we are using the makefile build method to install some binaries (pg_dump/pg_restore) and copy those along with their libraries to the layer for use by the lambda functions.
It seems there is a mismatch between the lambda runtime and the OS used at build time causing library version issues (Amazon Linux 1 seems to have outdated versions compared to what should be available in Amazon Linux 2).
Contributor guide
Assessment
This issue has not been assessed yet.