Docker Flashcards
What is Docker
Docker is a powerful open-source containerization platform
that is used for building, deploying, and running applications.
Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.
We can say Docker is a container management service
What is Image in Docker
Image is a read-only templet with combination of instructions as file system and parameters used for creating a Docker container
sometimes referred to as snapshots
you may build an image which is based on the exist image like SQL
What is Container in Docker
A container is a runnable instance of an image
A container packages up code and all its dependencies, libraries and configuration so the application runs quickly and reliably from one computing environment to another
you can create, start, stop, move or delete a container using the Docker API or CLI
What is Registry (hub)
It is a public cloud-based registry provided by Docker for storing public images of the containers that anyone can use
What is Client in Docker
The Docker Client is the primary way that users interact with Docker
When you use commands such as docker run the client sends these commands to Docker which carries them out the docker command uses the Docker API
What is Docker Daemon
The Docker daemon is a service that runs on your host operating system listens for Docker API requests and managers Docker objects such as images, containers, networks, and volumes
What is Name Spaces
Is a technology called namespaces to provide the isolated workspace called the container when you run the container
Docker create a set of namespaces for that container
These namespaces provide a layer of isolation
Each aspect of a container runs in a separate namespace and its access is limited to that namespace
An application running in a container is isolated from the rest of the system and from other container but gives the illusion of running in its own OS instance
multiple Docker container can be run on the single operating system simultaneously you can manage those containers with Docker
Virtualization
Virtualization is technology that lets you create useful IT services it use a physical machine’s to distributing its capabilities among many users or environments
Advantage of Containerization
- Portability: Think write once run anywhere
- Lightweight: shares the host operating system’s kernel
- Scalable: be scaled up quickly
- Start up: in milliseconds
- Multiple containers :
- Simple and fast deployment :
- Secure : Isolation and Virtualization keep apps more secure
- Flexible and Loosely Coupled
Rest API
These are the underlying commands used by the CLI and other applications to interact with the Docker Daemon.
Docker objects
Docker objects are the building blocks that are managed by the docker daemon.
The most fundamental docker objects are images and containers.
Docker file
It is a text file that has all commands which need to be run for building a given image.
Docker Volumes
Volumes are a way to persist data for a container.
instead to use copy command we use Volume mapping
Volumes are managed using the CLI and the Docker API.
- sharing data between many different containers
- Separate container from storage
- on deleting container volume does not delete
Volumes are also helpful because they allow Docker to keep the containers slim by saving data in the volume rather than the writable layer that disappears with the container.
Docker compose = YAML file
The docker-compose file (YAML file) allows you to run multiple containers in an easy way
Moreover it makes it easy to set up those containers to talk to one another.
It’s a YAML file(.yaml or .yml) that includes key information including environment variables, ports, volumes etc.
Docker compose is the tool that makes creating and managing multi-container applications easier.