aws / aws/aws-lambda-base-images

Launch error: fork/exec /lambda-entrypoint.sh: exec format error

Open
#61 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
777
Forks
118
PR merge metrics
No merged PRs in 30d

Description

I'm building a lambda base image on apple M1 via the SAM template like so:

```yaml
Metadata:
DockerBuildArgs:
platform: linux/amd64
DockerTag: docker-tag-123
DockerContext: ../../
Dockerfile: path/to/Dockerfile
```

Building and deploying the stack along with the lambda docker image is fine however I get this error when invoking the function:

```bash
Launch error: fork/exec /lambda-entrypoint.sh: exec format error
```

I suspect this is an issue with the platform because when i run the image locally (on my apple M1) with the --platform set to "linux/amd64" it errors with the following:

```bash
docker: Error response from daemon: image with reference docker-tag-123 was found but does not match the specified platform: wanted linux/amd64, actual: linux/arm64/v8.
```

How do I get SAM to build a docker image as linux/amd64 or at least respect the DockerBuildArgs? Also where are the docs for the `Metadata` section?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.