Install Docker and add your user to the Docker group
# apt-get install docker.io
# groupadd docker
# usermod -aG docker $USER
Create a webpage in your system (outside any container)
$ mkdir ~/html
$ echo "<html><h1>Hello from Docker! :)</h1></html>" > ~/html/index.html
Start Docker daemon
# systemctl start docker
Need to temporarily disable selinux
# setenforce 0
Run nginx through Docker and link to local webpage previously created
# docker run -d -p 8080:80 -v ~/html:/usr/share/nginx/html nginx
Access localhost:8080
from a browser to see your page.
To kill the container, first get its id with
# docker container ls
Then, kill with
# docker kill <id>
The first three characters from the id are enough, or the name.
To attach bash to a Docker container, in case of troubleshooting
# docker exec -it <id> bash
Don't forget to reenable selinux
after everything is done!
# setenforce 1