On this page
article
Pushing to DockerHub
Pull nginx image from dockerhub using
Run Docker with ngnix
–name docker-nginx : Name given to the container that is run is docker-nginx-p 80:80 : the port we are exposing and mapping from local machine port number to that of container, in the format local_machine_port:container_port-d : Detached mode – Runs the container in background
check all running docker containers
open localhost with specific port
Include a static Web Application in the Docker with NGINX
To include our static Web Application into the Docker Image with NGINX, we shall create a Dockerfile (including commands to build image) and an html file with name index.html (acting as our web application) in a directory named nginx-app.
create dockerfile with following content :
create index.html file with following content
Build Dockerfile
run updated ngnix webapp
List docker images
Tag Docker Images
Login into Your DockerHub Account
Last updated 9 days ago.