我知道一个老问题,但您可以在 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.