This commit is contained in:
Carl 2025-04-04 15:00:28 +02:00 committed by GitHub
commit 4aefad7f7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View File

@ -20,7 +20,7 @@ into depth, it covers the following topics:
If you wish to run the tutorial, you can use the following command after installing Docker Desktop: If you wish to run the tutorial, you can use the following command after installing Docker Desktop:
```bash ```bash
docker run -d -p 80:80 docker/getting-started docker run -d -p 9080:80 docker/getting-started
``` ```
Once it has started, you can open your browser to [http://localhost](http://localhost). Once it has started, you can open your browser to [http://localhost](http://localhost).

View File

@ -9,20 +9,32 @@ Let's first explain the command that you just ran. In case you forgot,
here's the command: here's the command:
```cli ```cli
docker run -d -p 80:80 docker/getting-started docker run -d -p 9080:80 docker/getting-started
``` ```
You'll notice a few flags being used. Here's some more info on them: You'll notice a few flags being used. Here's some more info on them:
- `-d` - run the container in detached mode (in the background) - `-d` - run the container in detached mode (in the background)
- `-p 80:80` - map port 80 of the host to port 80 in the container - `-p 9080:80` - map port 9080 of the host to port 80 in the container
- `docker/getting-started` - the image to use - `docker/getting-started` - the image to use
!!! info "Deep Dive"
One thing you may come across if you already have development environments
set-up is that you may be using ports already. Port 80 is frequently blocked
by IIs in Windows. By using port 9080 there's a good chance nothing will conflict.
If you have port 9080 used by another process, you can change to another port by
changing the -p argument. E.g. to use port 9999
```
docker run -d -p 9999:80 docker/getting-started
```
!!! info "Pro tip" !!! info "Pro tip"
You can combine single character flags to shorten the full command. You can combine single character flags to shorten the full command.
As an example, the command above could be written as: As an example, the command above could be written as:
``` ```
docker run -dp 80:80 docker/getting-started docker run -dp 9080:80 docker/getting-started
``` ```
## The Docker Dashboard ## The Docker Dashboard