In today’s world, automation taking place at a brisk pace across industries, especially in the tech space; domestic software firms are set to slash headcounts by a massive 3 million by 2022! So, the need to up-skill is now or never.
In this blog post, I will share the Docker Certified Associate free live class session and some quick tips, including Q/A and blog posts on the topics that we covered in a free live session.
What You’ll Learn Today:
- Monolithic and Microservice
- Introduction to Docker and Container
- Docker Installation & Architecture
- Docker Images
- Container Lifecycle
- Docker Storage
- Docker Networking
- Docker File
- Orchestration
- Docker Demo on Jenkins
Here are the topics covered and Q/A from the live training.
Monolithic and Microservice
We started with Monolithic & Microservice Applications, in this, we explain different type of deployment methods for applications, what is the monolithic applications and drawback of it, how we can solve these drawbacks using the microservice deployment, what is the difference between Monolithic & Microservice Application, why we are using microservice type application deployment for Kubernetes.
Q) What is the difference between Microservices architecture and Monolithic architecture.
Ans: A Monolithic Application is built as a single unit that combines the user interface and database into a single program running on a single platform. A monolithic program is self-contained and unrelated to other computer programs.
Advantages of Monolithic application.
- Easy to Deploy.
- It can be Scaled with Little Effort.
- Easy to Test.
- Development is Easy.
Microservices is an architectural design for developing a distributed application using containers. Microservices get their name from the fact that each function of the program runs as a separate unit. This model enables each service to scale or upgrade independently without interfering with other resources in the framework.
Advantages Of Microservices
- Every service can be independently scaled.
- It can be deployed independently.
- It allows each service to be built separately by a team dedicated to that service.
- It lowers the barrier to introducing emerging technology because developers are free to select whatever technologies make sense for their service rather than being restricted to the choices made at the outset of the project.
To know more about the Monolithic v/s Microservices
Q) Is Containers are based on N-Tier Architecture. Also, is Microservice a must for containers?
Ans: No, Container and N-Tier Architecture(monolithic) are different terms. We can use a container to deploy an N-tier application. The microservice application can be deployed without containers.
Introduction to Docker and Container
After going through the basics of Monolithic & Microservice Applications, we started to discuss Docker and Container; Docker is a containerisation platform that is used to create containers. We can deploy our application into the Container through an image.
If you are new to the docker watch video on the Docker Tutorial for Beginners: 5 Hour Full Course [Hands-On Labs]
FAQ’s asked in the session are:
Q) Is Docker Engine and Hypervisor are used for the same purpose?
Ans: No, they are used for a different purpose. A hypervisor is an emulator; it is computer software, firmware, or hardware that creates and runs virtual machines(VM). On the other hand, Docker Engine runs Inside virtual machines(VM).
Q) What is Containerized Application?
Ans: A containerisation is an operating system virtualisation in which programs are run in an isolated user-space called containers while sharing the same operating system (OS). A container is a fully packaged and compact computing environment.
Docker Installation & Architecture
Here we started with an explanation of client-server architecture and how Docker leverage the use of client-server architecture. The docker client talks to the Docker daemon, which is used to build, run, and distribute the Docker containers. Also, Install Docker In Virtual Machine.
Docker is available for download and installation on Windows OS, Linux, and macOS. You can choose any of the following Machines to Install Docker.
To know how to install docker on your machine, read our blog on Docker Installation.
Q) What do you mean by Docker daemon?
Ans: A context loop that handles Docker images, containers, networks, and storage volumes. The Docker daemon is the one listening for Docker API requests and processing them.
Docker Images
A Docker image is a read-only template containing instructions for building a container that can run on the Docker platform. It offers an easy way to package up the software and preconfigured cloud environments that you can use privately or openly with other Docker users.
Q) What is the difference between Docker Registry and Repository?
Ans: A Docker repository is where you can store one or more versions of a specific Docker image. An image can have one or more versions (tags), and a registry is a place where it stores a collection of repositories.
Container Lifecycle
When a container is created, it will go through various life stages that are called as Container lifecycle. We discussed each stage in Container Lifecycle in detail.
Q) What does pause mean in Docker container Lifecycle?
Ans: Docker pause is used to pause the running container. The command used for pausing a container is Docker pause container-id or name. It can be unpaused using the command Docker unpause container-id or name.
Docker Storage
In a traditional bare-metal application, storage is just a device that is attached to an image. But docker containers handle storage in different ways. The docker image usually contains a writable layer, which is only useful for stateless, non-persistent data and is insufficient for data storage or stateful persistent device data needs. The following are the types of docker Storage Volume mount, Bind mount, and tmpfs mount.
Q) What is OverlayFs?
Ans: OverlayFS is a union mount filesystem implementation for Linux. It is a new file system similar to AUFS. It uses a simpler implementation, and it is faster. Docker provides two storage drivers for OverlayFS that are overlay and overlay2.
Q) What are the different types of mounts available in docker?
Ans:
- Volume mounts are stored as a part of the host filesystem, and it is managed by docker. It cannot be modified by a Non-Docker process. Volumes are used to persist data in Docker.
- Bind mounts can be stored anywhere in the host system. Bind mounts are used to store important system files and directories. Bind mount can be modified by any process.
- tmpfs mounts are stored in the host system memory, and it is temporary storage.
Now we will explore Docker Networking.
Docker Networking
Networking environments are crucial in Docker architecture. Which network driver should I use? This is a common question in Docker Network. Each driver has its pros and cons. We have built-in network drivers in docker, and various plugins are also available. The most commonly used built-in network drivers are bridge, overlay and macvlan.
Read our Blog: Docker Network: An Introduction to Docker Networking
Q) What is the difference between docker network prune and docker network rm?
Ans: Docker network prune is used to remove all unused networks, and Docker network rm is used to remove one or more networks.
Q) What is the use of the netstat command?
Ans: It is used to display the network status using netstat. We can display the status of TCP and UDP endpoints in a table format, routing table information, and interface information.
Dockerfile
Through Dockerfile, we explained how we could make a custom docker image. It is nothing but a set of instructions that have to be passed on to Docker itself to build images automatically reading these instructions from that specified Dockerfile.
We also looked at the sample demo Dockerfile and how it can be built to create a running container and complete the flow of the same.
Q) What is a Dockerfile?
Ans: In simple words, we can say that Dockerfile is used to build docker images. A Dockerfile contains a list of instructions (commands), a docker image is built based on the docker file and the instruction that is defined inside the Dockerfile.
Q) Can you please explain the format of Dockerfile?
Ans: Please refer to the following jargon:
- FROM – a Dockerfile starts with FROM; it is used to defines the base image
- WORKDIR – It’s used to define the working directory.
- RUN – it is used to define what runs inside a container at build time
- COPY– it is used to copy files from different locations
- ADD -The ADD command is used to copy files/directories into a Docker image.
- ENTRYPOINT – it is used to define the entry point of a container. The command specified in ENTRYPOINT is run first when the container starts.
- CMD – is used to define a default command when a container starts.
- EXPOSE – It is used to define through which port we can access the container application.
- LABEL – to add metadata to the image.
Please go through our Blog Docker Images: A Complete Guide For Beginners.
Orchestration
In this section, we have seen who are big players in the orchestration technology, and here we have also described the orchestration by Kubernetes and Docker Swarm.
Docker swarm is a container orchestration tool, meaning that it allows the user to manage multiple containers deployed across multiple host machines. One of the key benefits associated with the operation of a docker swarm is the high level of availability offered for applications.
Let’s see the Docker demo on Jenkins.
Docker Demo on Jenkins
At last, we have installed & configured Docker and deployed Jenkins as Docker Container with Jenkins image through Docker Hub.
Related/References
- Docker Installation Overview
- Docker Certified Associate [DCA]: Everything You Need to Know
- Docker Tutorial | Full Course | Beginner to Advanced
- Docker Network: An Introduction to Docker Networking
- Docker Storage: Volume, Bind Mount, tmpfs, And NFS
Next Task For You
If you are considering in-depth learning about Docker Certified Associate (DCA) in the coming days, then do join our WAITLIST and don’t miss an opportunity to attend a free class and gain a plethora of insights on the basics of Docker and also the Docker Certified Associate Exam.
Leave a Reply