Okay.
We have just added the favicon icons into our project and now we in browser see actually that those
icons are added and we are able to see them here in the head section of the document.
Now let me demonstrate you how we are able to get rid of this absolute path here in volume mapping and
use variable instead.
Why is that important?
Answer is simple.
If you will take this command and try to execute it on your computer, you'll definitely will fail because
there is no such path on your computer.
But with variable, you will be able to run this command on any of the computers.
Okay, let me terminate this container control C Docker.
PS There are no containers currently running and now remember that we have used command PWD in order
to find out path to current folder.
And now let me show you how you are able to use the command in order to automatically insert absolute
path into the command that will create new container.
Let's use same container docker run and same port as before.
External port 8081.
Internal port 80.
And next comes volume mapping.
And here, instead of absolute path on your local computer, we will use variable in following way dollar
sign P.w.d..
That's it.
Next comes colon and again internal folder.
Same as we have used for nginx server before.
It is user share nginx.
HTML.
And next comes name of the image we want to create container from.
And image is the same.
Nginx.
Great recap that we are now located still in nginx folder that has index.html file and all remaining
favicon files.
It is important.
Let's press enter and now container should be running.
Let's go back to web browser refresh page here.
Actually let me use here localhost instead of my IP address because in your case IP address will be
different, but localhost is the same everywhere.
And let's refresh page recap that we have used same port as before in previous lectures.
Let's press enter.
And I see.
Same result.
Hello from the web page with fancy favicon.
And actually, in order to verify that we serve correct content and it is not served from the cache.
Let me modify this text.
Hello from the let's say nginx server like so save the file, go back to Chrome refresh page and yes
I see updated page and that means that this command works correctly.
We have used here variable as dollar sign d.
That's how it works and how you are able to insert automatically results of specific command basically
under the hood.
This computer executes command and inserts result basically result is here into this command.
But if I'll move to another folder, this path will be different.
And let me quickly actually show you that let me terminate this container and let me go one level up
to Containers folder, and if I'll enter here, you'll see this path.
Let me clear terminal and let's rerun the same command as before with dollar sign wd enter.
Go to Google Chrome refresh page and see this page forbidden.
And that means that something is wrong and there is actually no index.html file inside of that folder
that is now mapped to internal folder in nginx server.
Actually you are able to set it in the following way that in such cases web server will serve default
web page.
But now you see simply error forbidden.
That is important because now you understand that you need to go first to folder that has index.html
file and all remaining files and only there.
Run this command.
Great.
Let me terminate this container.
And now you know how to use variables in such commands as Docker run.
Also let me demonstrate you how you are able to run container in background.
But let's do that next.
Bye bye.