lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment
MIT License
5.83k stars 431 forks source link

Update of nodejs images #311

Closed Flarna closed 3 years ago

Flarna commented 3 years ago

I found that there is a difference between /var/runtime/init between the nodejs12.x image, the build-nodejs12.x image and that one within https://lambci.s3.amazonaws.com/fs/nodejs12.x.tgz

Is this intended?

I expected that the content of https://lambci.s3.amazonaws.com/fs/nodejs12.x.tgz is used for this. Or is this just a matter of timing as nodejs12.x has been published on 18.9. but build-nodejs12.x on 24.9.

By the way, these images are really great!

mhart commented 3 years ago

What difference have you found?

Flarna commented 3 years ago

Just compare the size of the files:

mhart commented 3 years ago

I'm assuming you're talking about /var/rapid/init, not /var/runtime/init?

It's a mock runtime, for running your code, copied here:

https://github.com/lambci/docker-lambda/blob/039ef1f767e2b1c0b443376c297ed71efca0f561/nodejs12.x/run/Dockerfile#L17

From here:

https://github.com/lambci/docker-lambda/blob/039ef1f767e2b1c0b443376c297ed71efca0f561/provided/run/Dockerfile#L11

Source code is here:

https://github.com/lambci/docker-lambda/blob/master/provided/run/init.go

The build image (and tarball) have the same file that's running live on Lambda – not the mock version – but you can't run your code with that because it's expected to be in a live Lambda environment

mhart commented 3 years ago

Can you explain what you're trying to do, I'm just understanding how best I can help with this issue you've opened?

Flarna commented 3 years ago

Yes, it's /var/rapid/init.

Ah ok, that explains the diff. Thinking once more about this its quite clear that something needs to be mocked.

Therefore any changes done by AWS in init require some change in the mock - which in turn depends on docs from AWS.

ok thanks for clarifying. I thought the diff was caused by some publishing issue.

Flarna commented 3 years ago

@mhart I was looking for the extension APIs meanwhile documented there.

mhart commented 3 years ago

The images are up to date – that API will need to be added to the existing mock implementation