问题
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