docker_file = is a simple text file with instructions to build a image
-
Create a file name Dockerfile
-
Add instructions to docker file. (RUN gets executed when building image from dockerfile and CMD gets executed when you create a container from a image )
-
Build dockerfile to create image NOTE docker build . (if the docker file is present in the current location, else you need to give the full location)
docker build -t myimage1:1.0 .
Usage - docker build will create a image from dockerfile. Give image name with tag.
- run image to create container
docker run image_id
will output "Hello World! from my first docker images"