Docker and its brief
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
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 Client:
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.Ā
Docker Registries:
It is the location where docker images are stored
Docker Objects
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
LABEL instruction is used to specify metadata informations to an image. A LABEL is a key-valueĀ pair.
EXPOSE
EXPOSE instruction is used to inform about the network ports that the container listens on runtime
ADD
Add the files to the images(ADD supports remote urls(not encourged to use) and automaticalls unzips tar balls
COPY:
copy the files to image
RUN
RUN instruction is used to executes any commands on top of the current image and this will create a new layer.
CMD
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
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.