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