Skip to content

Commit 1258d83

Browse files
friismBillWagner
authored andcommitted
simplify getting IP address (#1107)
1 parent 405525b commit 1258d83

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

docs/framework/docker/aspnetmvc.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -186,26 +186,11 @@ The `mvcrandomanswers` is the name of the image to start.
186186
> the IP address of the container.
187187
188188
Once the container starts, you'll need to find its IP address so that you
189-
can connect to your running container from a browser. You use the `docker exec`
190-
command to do that:
189+
can connect to your running container from a browser:
191190

192191
```
193-
docker exec randomanswers ipconfig
194-
```
195-
196-
You will see an output similar to this:
197-
198-
```
199-
Windows IP Configuration
200-
201-
202-
Ethernet adapter Ethernet 2:
203-
204-
Connection-specific DNS Suffix . :
205-
Link-local IPv6 Address . . . . . : fe80::91d:ce97:dd27:460d%5
206-
IPv4 Address. . . . . . . . . . . : 172.31.194.61
207-
Subnet Mask . . . . . . . . . . . : 255.240.0.0
208-
Default Gateway . . . . . . . . . : 172.16.0.1
192+
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" randomanswers
193+
172.31.194.61
209194
```
210195

211196
You can connect to the running container using the IPv4

0 commit comments

Comments
 (0)