update get started (#18876)

Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
This commit is contained in:
Craig Osterhout 2023-12-08 08:44:04 -08:00 committed by GitHub
parent 019a9f79d2
commit 466d833ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -128,11 +128,16 @@ Now that you have an image, you can run the application in a container using the
```
The `-d` flag (short for `--detach`) runs the container in the background.
The `-p` flag (short for `--publish`) creates a port mapping between the host and the container.
The `-p` flag takes a string value in the format of `HOST:CONTAINER`,
where `HOST` is the address on the host, and `CONTAINER` is the port on the container.
The command publishes the container's port 3000 to `127.0.0.1:3000` (`localhost:3000`) on the host.
Without the port mapping, you wouldn't be able to access the application from the host.
This means that Docker starts your container and returns you to the terminal
prompt. You can verify that a container is running by viewing it in Docker
Dashboard under **Containers**, or by running `docker ps` in the terminal.
The `-p` flag (short for `--publish`) creates a port mapping between the host
and the container. The `-p` flag takes a string value in the format of
`HOST:CONTAINER`, where `HOST` is the address on the host, and `CONTAINER` is
the port on the container. The command publishes the container's port 3000 to
`127.0.0.1:3000` (`localhost:3000`) on the host. Without the port mapping,
you wouldn't be able to access the application from the host.
2. After a few seconds, open your web browser to [http://localhost:3000](http://localhost:3000).
You should see your app.