To make all ports of a Linux system running in Docker accessible from a Windows environment, you need to follow these steps:
Ensure that Docker is installed on your Linux system.
Create a Docker container and expose all the ports that you want to access from Windows by using the following command:
docker run -p 0.0.0.0:{port}:80 -p 0.0.0.0:{port}:443 -p 0.0.0.0:{port}:22 {image name}
The -p
option specifies the port mapping between the container and the host system. The 0.0.0.0
IP address is used to expose the container ports to all network interfaces.
Check the IP address of your Linux system by running the ifconfig
command.
On your Windows system, open a browser and enter the IP address of your Linux system followed by the port number that you want to access. For example, if your Linux system IP address is 192.168.1.100
and you exposed port 8080
, you can access it by entering http://192.168.1.100:8080
in your browser.
Note that you may need to configure your firewall settings to allow incoming connections to the Docker container port on your Linux system.
Asked: 2022-10-02 11:00:00 +0000
Seen: 8 times
Last updated: May 04 '21