Update network-tutorial-host.md

- Modify the `docker run` command to remove the unnecessary flags "-i" and "-t". 
- Add a short description for the "--rm" option.
- Remove the "docker container rm" command which seems redundant due to "--rm" option.
This commit is contained in:
adshmh 2018-05-31 12:59:16 -04:00 committed by Joao Fernandes
parent 66e0628992
commit 7ee5554905
1 changed files with 3 additions and 4 deletions

View File

@ -28,10 +28,10 @@ host.
## Procedure
1. Create and start the container as a detached process.
1. Create and start the container as a detached process. The `--rm` option means to remove the container once it exits/stops. The `-d` flag means to start the container detached (in the background).
```bash
docker run --rm -dit --network host --name my_nginx nginx
docker run --rm -d --network host --name my_nginx nginx
```
2. Access Nginx by browsing to
@ -53,11 +53,10 @@ host.
sudo netstat -tulpn | grep :80
```
4. Stop the container.
4. Stop the container. It will be removed automatically as it was started using the `--rm` option.
```basn
docker container stop my_nginx
docker container rm my_nginx
```
## Other networking tutorials