When I run telnet command in Docker it does not run.
Could you please tell me how to install telnet in Docker for Windows?
When I run telnet command in Docker it does not run.
Could you please tell me how to install telnet in Docker for Windows?
There is a docker image for it:
docker run mikesplain/telnet <host> <port>
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"
hcs::CreateComputeSystem <some hash>: The virtual machine could not be started because a required feature is not installed.
–
External There is a docker image for it:
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 Telnet client in a running Windows Docker container. Just run this command in your container's terminal:
dism /online /Enable-Feature /FeatureName:TelnetClient
© 2022 - 2024 — McMap. All rights reserved.
docker run -it ubuntu bash
gives you a shell in ubuntu. There you can use the normal shell commands, e.g.apt-get update && apt-get install xinetd telnetd
see here. After this you have telnet installed and can use it withtelnet <ip>
. But you have no understanding what Docker is, so you should learn this first. – Stringency