Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 766 Bytes

docker_file.md

File metadata and controls

27 lines (19 loc) · 766 Bytes

DOCKER FILE

docker_file = is a simple text file with instructions to build a image

  1. Create a file name Dockerfile

  2. 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 )

  3. 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.

  1. run image to create container
docker run image_id

will output "Hello World! from my first docker images"