You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
host# nmap -sT 127.0.0.1 -p 7000-9000
Starting Nmap 7.40 ( https://nmap.org ) at 2017-01-26 16:53 GMT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00069s latency).
Not shown: 2000 closed ports
PORT STATE SERVICE
7396/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 18.41 seconds
container# nmap -sT 127.0.0.1 -p 7000-9000
Starting Nmap 7.40 ( https://nmap.org ) at 2017-01-26 16:54 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000096s latency).
Not shown: 2000 closed ports
PORT STATE SERVICE
8000/tcp open http-alt
Nmap done: 1 IP address (1 host up) scanned in 0.08 seconds
Steps to reproduce the behavior
docker run -it --net="host" alpine sh
# apk add --update nmap python
# python -m SimpleHTTPServer
After this, scan 127.0.0.1 using nmap for ports between 7000 and 9000
The text was updated successfully, but these errors were encountered:
Unfortunately --net=host is not supported on Docker for Mac, as in this case the "host" involves a Linux virtual machine and an OSX host (which do not share the same network devices). What is your use-case? If you just want to open the port 8000, you can use the usual -p option without the --net option (but I guess you have an other use-case in mind).
Implement --net=host for Docker for Desktop is a big chunk of work which is not planned in the short term.
I am closing this issue as a duplicate of #1031, feel free to monitor updates on that issue if you are interested in following progress on that issue.
Expected behavior
I started a server on port 8000 (python -m SimpleHTTPServer) in a container in host networking mode. I expected to see that port open in the host
Actual behavior
The port was not open on the host
Information
Steps to reproduce the behavior
After this, scan
127.0.0.1
using nmap for ports between 7000 and 9000The text was updated successfully, but these errors were encountered: