File tree Expand file tree Collapse file tree
docs/reference/commandline Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1290,10 +1290,17 @@ The following example shows how the special `host-gateway` value works. The
12901290example runs an HTTP server that serves a file from host to container over the
12911291` host.docker.internal ` hostname, which resolves to the host's internal IP.
12921292
1293+ In one terminal, create the file and start an HTTP server:
1294+
12931295``` console
12941296$ echo " hello from host!" > ./hello
12951297$ python3 -m http.server 8000
12961298Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
1299+ ```
1300+
1301+ In another terminal, run a container that connects to the HTTP server:
1302+
1303+ ``` console
12971304$ docker run \
12981305 --add-host host.docker.internal=host-gateway \
12991306 curlimages/curl -s host.docker.internal:8000/hello
You can’t perform that action at this time.
0 commit comments