Hi Everyone!
I have deployed docker desktop with Linux container and my requirement is Linux container should connect with outside network.
Need your suggestion how to achieve this.
Share and learn in the Docker community.
Hi Everyone!
I have deployed docker desktop with Linux container and my requirement is Linux container should connect with outside network.
Need your suggestion how to achieve this.
How do you want to connect? Dou you need a dedicated LAN IP address or is port forward enough? What is your use case?
Hi ,
Thanks for your response.
I want to connect Linux docker container via putty tool from external network.
Hi,
do you have any solution to connect Linux docker container via putty tool from external network.
Sorry I forgot about you. Does âconnect via putty toolâ means you want to use SSH to log in the container?
If you have everything in the container you need, then search for âdocker port forwardâ. You will find this probably as the first result:
But I guess you already knew that and you still canât connect.
So check your firewall settings. On Windows you need to open the port on the firewall:
Rimelek,
Thanks for the response.
my requirement is to access the container from my laptop with putty.
How can I achieve this
Please, react to my recommendations what you have already tried and what you know, because I think I gave you all the information you need but I donât know if you tried what I suggested so I cannot give you more advice.
Rimelek,
Yes, I did changes as per your suggestion, but still the issue persist.
What did you change? Sorry I try to follow you but if you donât tell me what you did exactly then we can misunderstand eachother. Just today I helped one of my colleagues and he did almost everything right in theory so I couldnât help him until he showed me his config file which contained a space on the first lineâŠ
Rimelek,
I could not explain everything on the chat, so it will be worth if you take my system access and would show you the error practically for better understanding. let me know if you are ok with it.
How would that work? Would it be a user and a password to log in and see something you canât share here.
From your point of view sharing such personal data would not be wise. I trust myself but you know⊠you shouldnât If you could write step by step what you did, that would be the best like
So this is what I thought you could do. Just some very clear steps so I know what you are trying to achieve because putty is just a program to use SSH or telnet as far as I know but you still didnât describe how you want to use it. I think it is explainable on a forum but if you try it and that is not enough, I will consider what you suggested
Hi Rimelek,
Thanks for your response. Indeed I will not share my PC considering you point.
However I have tried to write the steps followed for the installation
On windows 10 PC, deployed docker desktop.
In Windows PowerShell, executed this âDocker run -t -d âname red Ubuntu 22:04â and installed image.
Started docker container with this command " docker start red".
Verified using âdocker PSâ and Docker container was running
Entered in to Linux container with âdocker exec -it red bashâ .
In the container, verified ping status by pinging to website google.com, and it was pinging.
Enabled ssh in the container.
After performing the above steps. By default I have now container IP assigned by bridge network is 172.17.0.2.
In Windows Firewall, set rule for inbound and outbound as per the instruction in the document given by you.
With this IP 172.17.0.2 i am trying to access the container through putty from my PC and landing with error âconnection timed outâ
My requirement is to establish communication between the docker containers and the outside world via host machine with putty.
Hope I tried to convey my problem with this
I expected an explanation exactly you gave me now
This would not work so I am sure you didnât executed the quoted command but I will suppose you did it correctly and quoted wrong.
docker run
starts the container. This step is not necessary unless you stop the container first.
You canât use the the internal IP address from Windows given by Docker.
I thought you did what I suggested in my first comment:
This is required on Windows even if you want to connect from the same machine because it is not the same machine from the Dockerâs point of view. The containers are in a virtual machine so you need to use docker run
with -p HOSTPORT:CONTAINERPORT
and access your container using the host port.
I donât actively use Docker Desktop so if anyone knows another way, correct me
To connect to remote device securely you can use networking client PuTTY. It allow you to establish SSH connection and able to perform function with command line interface. To check the process of connecting to remote connection click here.