user84592
user84592

Reputation: 4882

Docker container, Centos, how to telnet

I have a centOS virtual machine. I have several dockers into and use k8s to coordinate docker containers. When I ssh into one docker container, how to telnet other container, I notice I could ping, but telnet.

Upvotes: 1

Views: 8908

Answers (2)

Kavyesh Shah
Kavyesh Shah

Reputation: 62

Why you need telnet to other container? if you want to copy files from one container to another container then you can use

docker cp <containerid>:<path/to/copy> <conatinerid>:<path/to/copy>

Docker container is like lightweight os that has minimum but necessary requirements and telnet is definitely not one of them but still if you want telnet in container and you are using ubuntu image you can install telnet in container with

apt-get update && apt-get install telnet

And if you are using another image you can include telnet in a docker file and from that image you can use telnet into container.

Sorry for writing this in answer. Not having reputation for comment but i hope you can understand.

Upvotes: 2

asatsi
asatsi

Reputation: 472

To understand your question correctly, do you meant to say telnet is not found inside the running container? If not then you can install if while building the image itself.

Upvotes: 4

Related Questions