Docker and its brief
Components of Docker and its Brief Summary:
Docker Components :
Docker Engine: Core part of the docker system. It consists following 3 components:
- Server: It is the docker daemon called dockerd. It can create and manage docker images. Containers, networks, etc.
- Rest API: It is used to instruct docker daemon what to do.
- Command Line Interface (CLI): It is a client which is used to enter docker commands
Docker users can interact with Docker through a client. When any docker commands runs, the client sends them to dockerd daemon, which carries them out.
It is the location where docker images are stored
When you are working with Docker, you use images, containers, volumes, networks; all these are Docker objects.
Difference between docker pause and unpause?
docker pause: Pause running process inside docker container.
docker unpause: Resume the paused process inside docker container
Difference between docker stop and kill?
docker stop : Stop the container
docker kill: Terminate the entrypoint process
What is the differenet between docker exec and attach?
docker exec: Run new process already started container
docker attach: To 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.
List of dockerfile instructions and its Brief Summary?
FROM: Docker Image will be downloaded from docker hub registry if it is not exists locally
LABEL instruction is used to specify metadata informations to an image. A LABEL is a key-value pair.
EXPOSE instruction is used to inform about the network ports that the container listens on runtime
Add the files to the images(ADD supports remote urls(not encourged to use) and automaticalls unzips tar balls
copy the files to image
RUN instruction is used to executes any commands on top of the current image and this will create a new layer.
CMD instruction is used to set a command to be executed when running a container. There must be only one CMD in a Dockerfile. If more than one CMD is listed, only the last CMD takes effect.
ENTRYPOINT instruction is used to configure and run a container as an executable. It will be main process inside the container. So it will run after starting the container
What is the differenet between CMD vs Entrypoint?
CMD commands are ignored by Daemon when there are parameters stated within the docker run command.
ENTRYPOINT instructions are not ignored but instead are appended as command line parameters by treating those as arguments of the command.