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

ECR: do not assume a node runtime for image-based builds #1604

Open
pkit opened this issue Sep 14, 2023 · 0 comments
Open

ECR: do not assume a node runtime for image-based builds #1604

pkit opened this issue Sep 14, 2023 · 0 comments

Comments

@pkit
Copy link

pkit commented Sep 14, 2023

It's kinda the same problem that was partially fixed in #877
Let's consider a serverless.yml

provider:
  name: aws
  runtime: nodejs18.x
  ecr:
    images:
      python-image:
        path: ./docker/python
functions:
  nodeFunction:
     handler: bla/bla
  pythonFunction:
     image:
       name: python-image
       command: app.handler

What will happen?
It will fail miserably by trying to bundle python code with webpack.
Why?
Because provider.runtime: nodejs18.x doesn't mean that every Dockerfile in provider.ecr.images uses FROM public.ecr.aws/lambda/node:18
But it's silently assumed.
I.e. not only image.urishould be excluded from bundling, but any image that is not derived from public.ecr.aws/lambda/node

Just in case, a sample of ./docker/python/Dockerfile:

FROM public.ecr.aws/lambda/python:3.10

COPY app.py .

CMD ["app.handler"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants