DevOps Classroom notes 12/May/2026

Creating Docker Images

  • Creating docker images can be done
    • Interactively
    • By specifying instructions in a file

Interactively – Lets create a docker image for a website

  • To create a website we need to have

    • web server
    • web design
  • Lets create a docker container with nginx image
docker run -d --name web1 -p 80:80 nginx
  • Now download a zip file and extract
mkdir website
cd website/
wget https://templatemo.com/tm-zip-files-2020/templatemo_623_novapay.zip
ls
unzip templatemo_623_novapay.zip
ls
cd templatemo_623_novapay/
  • We can copy contents of folder from host into container
docker cp . web1:/usr/share/nginx/html/
  • Now access docker container by using ip of the server
    Preview
  • Now lets save the image of this contianer
docker commit web1 novapay
docker image ls
  • Now remove the continaer docker rm -f web1 and create a new contianer with novapay image
docker run -d --name web2 -p 80:80 novapay
  • Remove the contiainer
docker rm -f web2
  • this approach works but requires lot of manual steps for creating image thats where we have docker instruction based image creation which is referred as Dockerfile

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube