Docker Flashcards
What is Container?
Containers are a form of operating system virtualization. A single container might be used to run anything from a small microservice or software process to a larger application. Inside a container are all the necessary executables, binary code, libraries, and configuration files.
Why we need container?
Containers require less system resources than traditional or hardware virtual machine environments because they don’t include operating system images. Applications running in containers can be deployed easily to multiple different operating systems and hardware platforms.
What is difference between containerization and virtualization?
The cloud is a multi-tenant environment where multiple people run services on the same server hardware. To achieve a shared environment, cloud providers use virtualization technology.
Virtualization is achieved using a hypervisor, which splits CPU, RAM, and storage resources between multiple virtual machines (VMs). Each user on the hypervisor gets their own operating system environment.
Containerization is a form of virtualization. Virtualization aims to run multiple OS instances on a single server, whereas containerization runs a single OS instance, with multiple user spaces to isolate processes from one another. This means containerization makes sense for one AWS cloud user that plans to run multiple processes simultaneously.
What is difference between a monolithic and microservice?
A monolithic application is built as a single unified unit while a microservices architecture is a collection of smaller, independently deployable services.
Command to get Docker version?
docker –version
Command to get information about a container?
docker inspect <container_name></container_name>
How to pull Docker image?
docker pull <name_image></name_image>
Command to check images available in local Docker engine?
docker images
How to remove image?
docker rmi <name_images></name_images>
What are modes to spin a container?
Interactive and detached
Command to spin up a in detached mode container?
docker run -d name of the container
Command to spin up a in interactive mode container?
docker run - -it nginx
How to spin up a container by name?
docker run –it - -name mayo_ubuntu ubuntu
Command to check the running containers?
docker ps
Command to check all the containers available?
docker ps -a
How to start a container?
docker start <name_container></name_container>
How to stop a container?
docker stop <name_container></name_container>
How to remove a container?
docker rm <container_name></container_name>
How to get more detailed information about a container?
docker inspect <container_name></container_name>
How to list docker networks?
docker network ls
How to create a docker network?
docker network create - -driver bridge <network_name></network_name>
What to map a port with the local port of a container?
–p
docker run -d –name web -p 8080:nginx
Who is responsible for the mapping of container port?
docker proxy
What is your experience with Docker. Please give me brief idea of your background with containers?
Containers are lightweight and portable, and they allow developers to isolate applications from one another and from the underlying host operating system. This makes it easier to deploy and run multiple applications on the same machine without them interfering with each other.