- Components of Docker and its Brief Summary
Docker client and server
The Docker client talks to the Docker daemon, which does the heavy lifting of building, running, and distributing your Docker containers. The Docker client and daemon can run on the same system, or you can connect a Docker client to a remote Docker daemon.
A Docker image is a file used to execute code in a Docker container. Docker images act as a set of instructions to build a Docker container, like a template. Docker images also act as the starting point when using Docker. An image is comparable to a snapshot in virtual machine (VM) environments.
A Docker registry is a storage and distribution system for named Docker images. The same image might have multiple different versions, identified by their tags. A Docker registry is organized into Docker repositories , where a repository holds all the versions of a specific image.
A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
- What is the differenet between docker pause and unpause?
pause – to stop the process running inside containers and signals will stop
inpause- to resume the paused process inside containers and signals will continue
3.what is the difference between docker kill and docker stop?
The difference between ‘docker kill’ and ‘docker stop’ is that ‘docker stop’ gives the container time to shutdown gracefully, in situations when it is taking too much time for getting the container to stop, one can opt to kill it
- What is the differenet between docker exec and attach?
The exec command is used to interact with already running containers on the Docker host. It allows you to start a session within the default directory of the container.
attach your terminal’s standard input, output, and error (or any combination of the three) to a running container using the container’s ID or name. This allows you to view its ongoing output or to control it interactively, as though the commands were running directly in your terminal.
5.List of dockerfile instructions and its Brief Summary?
FROM – Creates a layer from the ubuntu:18.04
PULL – Adds files from your Docker repository
RUN – Builds your container
CMD – Specifies what command to run within the container
6.What is the differenet between CMD vs Entrypoint
The ENTRYPOINT instruction looks almost similar to the CMD instruction. However, the main highlighting difference between them is that it will not ignore any of the parameters that you have specified in the Docker run command (CLI parameters).
- List of 20 docker commands and its use cases with example?
This command is used to pull images from the docker repository(hub.docker.com)
This command is used to create a container from an image
-> docker ps
This command is used to list the running containers
->docker ps -a
This command is used to show all the running and exited containers
This command is used to access the running container
-> docker stop
This command stops a running container
This command kills the container by stopping its execution immediately.
-> docker commit
This command creates a new image of an edited container on the local system
This command is used to push an image to the docker hub repository
This command lists all the locally stored docker images
This command is used to delete a stopped container
This command is used to delete an image from local storage
This command is used to build an image from a specified docker file
This command is used to stop the container
This command is used restart the container
This command is used to get the currently installed version of docker