5

I downloaded an image public.ecr.aws/lambda/python:3.6 from this link and I am trying to open an interactive terminal into this container image.

I tried the following tree approaches and none of these opens up any interactive terminal:

  1. docker run -it public.ecr.aws/lambda/python:3.6 bash

  2. docker run -it public.ecr.aws/lambda/python:3.6 /bin/bash

  3. docker run -it public.ecr.aws/lambda/python:3.6 sh

This is the output I get in all the above three commands, it seems to be displaying the container logs rather than opening up an interactive terminal within the container image

INFO[0000] exec '/var/runtime/bootstrap' (cwd=/var/task, handler=)

Please help

4
  • Have you tried running python instead of bash? Commented Aug 2, 2021 at 8:15
  • Nope, not tried yet. I don't need to execute any python commands actually, I need to install a few unix executables and hence looking for an interactive terminal Commented Aug 2, 2021 at 8:20
  • 1
    @user182944 That is not how you do that. You create your own Dockerfile which is build upon public.ecr.aws/lambda/python:3.6 and then in your Dockerfile you install the software that you need and run this image. Commented Aug 2, 2021 at 8:26
  • 1
    Agreed, but some packages that I need are breaking and hence its easier to open an interactive terminal and try it out manually, then will convert it into a working Dockerfile Commented Aug 2, 2021 at 8:27

2 Answers 2

12

ok, here's the answer 1 year and 3 months late ;-) but hopefully will be useful for someone.

docker run -it --rm --entrypoint /bin/bash public.ecr.aws/lambda/python:3.9

You just need to overwrite entrypoint, which was set to a shell script in the base image:

https://github.com/aws/aws-lambda-base-images/blob/python3.9/Dockerfile.python3.9#L18

Sign up to request clarification or add additional context in comments.

Comments

0

The image is not designed for interactive use. Once you have built an image with an actual lambda, call it with the name of that lambda as the first argument.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.