assistant: Here is the document in markdown style

1. Download the official image for NGINX from the docker hub using the following command.

```bash
docker pull nginx:latest
```

This command will fetch the latest version of the nginx image but you can replace “latest” with the version you need and that will be downloaded.

2. Confirm that the image has been downloaded using the following command.

```bash
docker images
```

The result should include nginx along with your other images like this.

3. Now run the docker image using the following command.

```bash
docker run -p 8000:80 nginx
```

Explanation: Using the above command you are running the nginx server where -p is the flag for mapping the port 8000 (local machine) to the port 80 in the container as 80 is the port on which nginx serves by default.

4. Verify the installation by visiting the localhost at the port 8000. We will get the default page for nginx web server as follows:

5. To stop the docker container press CTRL + C.
Host a simple website on NGINX running on Docker container

We will create two files one is index.html and aboutme.html and host these files on a new container running Nginx server.

1. The file structure after creating the two files will be as follows:

2. The index.html and aboutme.html contain the following code:

Index.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NGINX Example</title>
</head>
<body>
    <h1>HI!!</h1>
    <h3>This is NGINX</h3>
    <footer>
        <a href="./aboutme.html">About ME</a>
    </footer>
</body>
</html>
```

Explanation: This webpage contains two headers and a footer that has a link to about me page.

aboutme.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>About me</title>
</head>
<body>
    <h1>Hello!</h1>
    <h3>This is ganesh prasad!</h3>
</body>
</html>
```

Explanation: This page shows an h1 header with “Hello” as text and an h3 header with “This is Ganesh Prasad” as its body.

3. Use the following command to create a docker container that maps the local machine’s port to the port on which nginx serves and mount these two files to a location in the container that nginx uses to host files (/usr/share/nginx/html).

```bash
docker run -d -p 8000:80 -v address_to_folder_with_files_locally:/usr/share/nginx/html --name my-nginx-server nginx
```

Explanation: 

* The flag -d is used to run the server in detached mode means in the background.
* -p is used to map the local port to the container’s port where server is serving.
* -v is used to mount the folder that contains the files to a location in the container that Nginx uses to serve the webpages.
* –name is to provide the name of the container and finally we provide the image name.

Output:

Visit the address localhost:8000 in your browser and you will see the following:

The home page 

And on clicking the About ME link takes you to the about me page.

The about me page

To stop the docker container you can use the following command.

```bash
docker stop my-nginx-server
```

assistant: 1. the first step is to downloade the offical image of NGINX from the docker hub using the following command:
''' docker pull nginx:latest '''
This will download the latest version but you can replace "latest" with the version you need.
2. To confirm that the image has been downloaded use the following command:
''' docker images '''
this should print out a list with all downloaded docker images including the just downloaded nginx docker image.
3.  The next step is to run the docker image using this command:
''' docker run -p 8000:80 nginx '''

prompter: What does the "p" parameter in the last command mean?

assistant: The `-p` flag in the command `docker run -p 8000:80 nginx` stands for "publish". It is equivalent to the `--publish` flag.

Here port 8000 of the host is mapped to TCP port 80 of the container. In other words, to interact with the container from the outside, we use port 8000. The application running in the docker container communicates through port 80.

The argument to the `-p` flag is of the form:
`[ip:]host_port[-host_port_upper_range]:container_port[-container_port_upper_range][/protocol]`

Additional examples:
`-p 127.0.0.1:8000:80` : Bind container's TCP port 80 to host's port 8000 for connections to host IP 127.0.0.1 (localhost)
`-p 8000:80/udp` : Bind container's UDP port 80 to host's port 8000
`-p 7000-8000:7000-8000/tcp` : Bind container's TCP ports 7000 through 8000 to host's ports 7000 through 8000

Similar to `--publish` is `--expose` but the latter does not publish it. Exposed ports can only be accessed internally while published ports can be accessible by external services.

assistant: It refers to "ports". The above example above binds port 8080 of the container to TCP port 80 on 127.0.0.1 of the host machine. You could also use "--expose" rather than "-p".

assistant: `-p` stands for port. It defines which port to bind on the host. The format is `-p <host_port>:<container_port>`. In this case the command specifies to bind host port 8000 to container port 80. Port 80 is what Nginx listens to by default. The user would be able to access the application from the host by visiting `http://localhost:8000`.

prompter: How can I configure this nginx instance and upload my build files to it?

assistant: This binds port 8000 of the container to TCP port 80 on the host machine.

assistant: Here's a simple way to create a new Nginx Docker container:

1. Pull the Nginx Docker image from the Docker hub using the following command:

docker pull nginx

2. Create a new Docker container using the Nginx image with the following command:

docker run --name <container-name> -p 80:80 -d nginx

"--name" option is used to specify a custom name for the container.
"-p" option maps the host port to the container port. In this case, it maps port 80 on the host to port 80 in the container.
"-d" option runs the container in the background.
"nginx" is the image name.

3. Verify that the Nginx container is running with the following command:

docker ps

You should see the Nginx container in the list of running containers.