How to get back to shell in nodejs:latest docker image?

Viewed 2668

I'm newbie to docker, I tried this command

docker run -it node:latest

then, I was in the node REPL,

Welcome to Node.js v16.3.0.
Type ".help" for more information.
>

I tried control+c ,but this quit the image,

Is there any way to go to the shell in this image?

1 Answers

In order to overwrite the entry point of the docker image you're using, you will need to use the --entrypoint flag in the run command.

docker run -it --entrypoint bash node:latest

For better understanding on how to work with already running docker container you can refer to the following question

Related