Hi There,
I'm using sam 0.5.0 on macOS and testing the start-api hot reloading with a nodejs 8.10 project.
On the first request, sam downloaded the lambci/lambda:nodejs8.10 and mounted my source directory as expected. At this point, I would not expect sam to fetch the Docker image again and only re-mount the source directory if something in my code changed.
Instead, it tries to fetch the Docker image and remounts my source directory with every request:
Fetching lambci/lambda:nodejs8.10 Docker container image......
2018-08-08 13:45:33 Mounting /source/code as /var/task:ro inside runtime container
I assume this is not the expected behavior.
This is expected behavior. If you already have the container locally (in your case the nodejs8.10), then you can use --skip-pull-image to remove the download.
We have some converstations here about changing this behavior (#529).
Here is the code where this happens.
Closing since it is expected behavior and already have other issues discussing ways we can improve this.
May be considerate to have an option to skip the image build.
Most helpful comment
This is expected behavior. If you already have the container locally (in your case the nodejs8.10), then you can use
--skip-pull-imageto remove the download.We have some converstations here about changing this behavior (#529).
Here is the code where this happens.
Closing since it is expected behavior and already have other issues discussing ways we can improve this.