Docker Assignment for Interview Preparations

Assignment – 2
Batch – July 2022

Write following questions in comments section!

1. Components of Docker and its Brief Summary

2. What is the differenet between docker pause and unpause?

3. What is the differenet between docker stop and kill?

4. What is the differenet between docker exec and attach?

5. List of dockerfile instructions and its Brief Summary?

6. What is the differenet between CMD vs Entrypoint

0 0 votes
Article Rating
Subscribe
Notify of
guest

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

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
B Vijay Kumar
B Vijay Kumar
1 month ago

1. Components of Docker and its Brief Summary
 docker client – a way for docker users to communicate with Docker
 docker host – consists dockerd(daemon),containers and images 
 registry – stores images. we can use docker pull to pull images from registry. 
2. What is the differenet between docker pause and unpause?
 pause – to stop the process running inside containers
 inpause- to resume the paused process inside containers
3. What is the differenet between docker stop and kill?
 – docker stop command stops the containers gracefully where as kill command terminates the entrypoint process abruptly(which can incurr of data or damage to file system)
4. What is the differenet between docker exec and attach?
 – attach – used for trouble shooting , to exit container to should be stopped.not user friendly to run the commands.
 – exec – we can get into running container and commands.
  
5. List of dockerfile instructions and its Brief Summary?
 – FROM – to pull base images like alpine,ubuntu,etc..
 – ADD – add the files to the images(ADD supports remote urls(not encourged to use) and automaticalls unzips tar balls
 – RUN – executes durint the image creation like RUN apk add wget
 – COPY – copy the files to images
 – EXPOSE – expose the port of the container
 – ENRTYPOINT[“java”,”jar”,”webappp.jar”] start the process you want to run after staring the container]
 – CMD – to pass on defaults for for an container.the paramenters for entry point can be passed using CMD.
       
 example : 
 CMD[“192.168.1.1”]
 ENTRYPOINT[“ping”,”-t”,”5″]
 
 this will ping the ip provided in CMD 5 times
 
6. What is the differenet between CMD vs Entrypoint
 – ENRTYPOINT[“java”,”jar”,”webappp.jar”] start the process you want to run after staring the container]
 – CMD – to pass on defaults for for an container.the paramenters for entry point can be passed using CMD.
       
 example : 
 CMD[“192.168.1.1”]
 ENTRYPOINT[“ping”,”-t”,”5″]
 

1
0
Would love your thoughts, please comment.x
()
x