Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting interactive terminal in a Python image container

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

like image 825
user182944 Avatar asked Oct 26 '25 09:10

user182944


1 Answers

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

like image 57
Tyn Avatar answered Oct 27 '25 21:10

Tyn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!