2

I'm looking at a way to run a docker container with all the requirements already provided to avoid to wait on the download of the requirements.

I'm debugging python lambda locally. I use the sam-cli integration in PyCharm.

To specify the requirements I have them all listed in a requirements.txt file.

When I run the debug sam build is executed with the user container setting. This goes an fetches all the requirements from the internet into the container and then executes it. When I'm working offline or with slow internet I would like to be able to use a container that has all the requirements. This will also be great to speed up the debugging process.

How can I setup my environment so it uses a pre-built docker container?

Amit Baranes
  • 7,398
  • 2
  • 31
  • 53
Yair Carel
  • 21
  • 1

1 Answers1

0

Build a new container base on old container and add a RUN instruction to install all you requirements to new layer on new image.

lamth
  • 149
  • 9
  • Can you give more details? I'm not sure what you meant. How do I tell sam-cli to use that container when invoking the lambda locally. – Yair Carel Dec 30 '19 at 13:38