It's All About (The) Docker file into a Docker Container
We used Oracle VM Box (Hypervisor) to create many VMs back when there was no cloud, which is an extremely labor-intensive approach.
Now that Docker has been introduced, we can create several virtual machines (VMs) with various operating systems and very small sizes (the base operating system).
Create our Image with Docker :
" Docker is a set of Instructions"
Need to create Dockerfile: open VS
And save only the Name –“Dockerfile”
Give the instruction:
"FROM ubuntu
MAINTAINER murali
RUN apt-get update
RUN apt-get install nginx –y"
Now Build it:
Command - “Docker build –t murali:latest .”
Now check whether the image file is created or not
Created image file: murali
Now open CMD and check whether once weather image is running or not
You can find Container ID, Image name, ports etc.
Stop the container:
Command: docker stop (container id )b652f5789151
Let's confirm whether it is stopped or not
“Docker ps”
These methods allow us to create several applications or virtual machines simply.
Thank you!
Hope this was helpful to you.