How to install telnet in Docker for Windows 10

∥☆過路亽.° 提交于 2020-01-15 10:31:27

问题


When I run telnet command in Docker it does not run.

Could you please tell me how to install telnet in Docker for Windows?


回答1:


There is a docker image for it:

docker run mikesplain/telnet <host> <port>



回答2:


Old question I know but you can install telnet on docker for windows with the following in your dockerfile

  RUN powershell -Command Add-WindowsFeature "telnet-client"



回答3:


If you are trying to telnet into your container to gain access to it, that isn't how you would want to connect. Docker provides that functionality.

Connect into a running container - Docs:

docker exec -it <container name> bash
$ root@665b4a1e17b6:/#

Start a container from image, and connect to it - Docs:

docker run -it <image name> bash
$ root@665b4a1e17b6:/#

Note: If it is an Alpine based image, it may not have Bash installed. In that case using sh instead of bash in your commands should work.



来源:https://stackoverflow.com/questions/39286441/how-to-install-telnet-in-docker-for-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!