简体   繁体   中英

How to install telnet in Docker for Windows 10

When I run te.net command in Docker it does not run.

在此处输入图像描述

Could you please tell me how to install te.net in Docker for Windows?

我知道一个老问题,但您可以在 dockerfile 中使用以下内容在 docker for windows 上安装 telnet

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

有一个 docker 图像:

docker run mikesplain/telnet <host> <port>

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.

If you were using Kubernetes, you could install telnet in k8s by running:

apk update
apk add busybox-extras
telnet 10.0.180.37 11211

The following command will work if you want to install Te.net client in a running Windows Docker container. Just run this command in your container's terminal:

dism /online /Enable-Feature /FeatureName:TelnetClient

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM