Ask Your Question
4

How can I make all ports of a Linux system running in Docker accessible from a Windows environment?

asked 2022-10-02 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-05-04 22:00:00 +0000

qstack gravatar image

To make all ports of a Linux system running in Docker accessible from a Windows environment, you need to follow these steps:

  1. Ensure that Docker is installed on your Linux system.

  2. 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.

  1. Check the IP address of your Linux system by running the ifconfig command.

  2. 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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-10-02 11:00:00 +0000

Seen: 8 times

Last updated: May 04 '21