如何解决如何回到 nodejs:latest docker image 中的 shell?
我是 docker 新手,我试过这个命令
docker run -it node:latest
然后,我在节点 REPL 中,
Welcome to Node.js v16.3.0.
Type ".help" for more information.
>
我试过 control+c ,但这退出了图像,
有没有办法进入这个图中的shell?
解决方法
为了覆盖您正在使用的 docker 镜像的入口点,您需要use the --entrypoint
flag in the run command。
docker run -it --entrypoint bash node:latest
为了更好地了解如何使用已经运行的 docker 容器,您可以参考以下question
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。