Day 2 assignment

1 . What is docker ?

Docker is an application which basically does the configuration of namespaces and the Cgroups of the linux underthhood . Docker is used to create images of the application which can be analogous to classes in OOPs and containers which is created are like objects of the class. Multiple containers can be created from the docker image

2. What is container ?

Container are the runtime instances of the docker image .

docker ps : To get the list of running containers

3. What are 5 advantages of docker?

  • Docker is used to deploy the microservices.
  • Docker are light weight and takes less time to run the application as compared to the virtual machines
  • Dockers uses the underlying linux kernel which makes light weight
  • Docker solves the problem of dependency hell .
  • Multiple instances of the same application can be run in the same machine at the same time

4. Top 10 commands

  • docker images : List the available images in the machine
  • docker ps : List of running docker containers
  • docker ps -a : List the running and the stopped containers
  • docker rm <container-name/id> : Removes the container
  • docker rmi <image-name/id> : Removes the image
  • docker stop <container-name/id> : Stops the running container
  • docker run -p 8082:8080 –name <container-name> <image-name> : Creates a docker container with given name and maps the host port to the container port
  • docker start <container-name> : To start the docker container
  • docker pull <repo-name/image-name> : To pull the image from the repo
  • docker push <image-name> : To push the image into the repo
Subscribe
Notify of
guest

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

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x