Docker Interview Question with Answer (Part1)
Farshad Nick (????? ??? ????)
DevOps Team Lead | 20k+ LinkedIn | Kubernetes | AWS | Terraform | Open for Collaboration
In these series of Docker Interview Question I’m going to Give you most common Docker interview Question that you can face with in?Your Devops interview??
Stay Tuned This is Part 1
1. What are the benefits of Docker?
2- What are the components of a Docker architecture ?
3- What is a Docker image?
A Docker image is a type of recipe/template that can be used for creating Docker containers. It includes steps for creating the necessary software.
4- What is a DockerFile?
Docker File Starts with a base image and?Contains Bunch of Commands that needs to be run when you are building Docker image
5- What is docker image registry?
is an area where the docker images are stored This image registry can either be public or private and Docker hub is the most popular and famous public registry available
6- How many Docker components are there
There are three docker components, they are Docker Client, Docker Host, and
Docker Registry.
7- How can we Export an image and import it to another Docker Server ?
With Docker save Command we can export an image to *.Tar File
docker save -o myimage.tar my-image-name
we can Transfer this file to Another Server (by scp)?and?Execute Command docker load -i *.tar? to import Desired Image to New Server
领英推荐
docker load -i myimage.tar
8- Di?erentiate between COPY and ADD commands in Dockerfile ?
COPY only supports the basic copying of local files into the container, while ADD has some features (like local-only tar extraction and remote URL support)
the best use for ADD is local tar file auto-extraction into the image
9- What kind of Docker Storage Drivers do we have ?
10 –What are the types of networks in Docker?
1. Bridge networks: This is the default network type when you run a container. A bridge network connects multiple containers within a single host, and provides isolation from the host network.
docker network create -d bridge my-bridge-net
2. Host networks: A host network configuration removes network isolation between the container and the Docker host. Containers on a host network have the same IP address and network access as the host.
3.?Overlay networks: An overlay network enables multi-host networking, meaning containers connected to the overlay network can communicate across multiple Docker daemon hosts
docker network create -d overlay --subnet=192.168.4.0/24 packops-overkay
4. Macvlan networks: Macvlan networks allow you to assign a MAC address to a container, giving it direct access to the host network. This type of network is useful when you want to expose a container directly to the host network, without NAT.
docker network create -d macvlan
--subnet=192.168.1.0/24 \
--gateway=192.168.1.1 \
-o parent=eth0 \
packops_macvlan_network
4. IPVLAN:?Ipvlan is same as macvlan with a little difference ipvlan Doesn’t create a mac address for each container (but macvlan generate different mac address from your linux mac address )
docker network create --driver ipvlan --subnet 192.168.0.0/16 --ipvlan_parent eth0 packops_ipvlan_network
You can Find me in :
My Instagram ?? : https://instagram.com/packosp.ir
My Github ?? : https://github.com/farshadnick
My Linkedin ?? : https://www.dhirubhai.net/in/farshadnickfetrat/
My Blog ?? : https://packops.dev/
Digital Marketing Associate | Passionate About Digital Transformation & Audience Engagement
1 年Attention tech enthusiasts! ???? SpringPeople's exclusive Docker training session is here! ?? https://www.dhirubhai.net/feed/update/urn:li:activity:7061658039090626560/ Upgrade your skills and learn how to deploy applications seamlessly with #Docker,? the industry-leading containerization platform. Join our expert trainers for a? comprehensive hands-on learning experience and become a certified Docker professional.? Don't miss out on this opportunity to enhance your career prospects and stay ahead of the game. Enroll now! ? Visit - https://lnkd.in/gzrqpEyz
DevOps Engineer | Golang | Python | Course Instructor
2 年Invaluable content, tnx a lot Farshad ?? ??