DOCKER
-----------------------------------------------------------------------------------------------------------------------------------
--------------------------
Docker is an open-source lightweight containerization technology. It has gained widespread
popularity in the cloud and application packaging world.
It allows you to automate the deployment of applications in lightweight and portable containers.
offers an efficient and easy initial set up
Allows you to describe your application lifecycle in detail
Simple configuration and interacts with Docker Compose.
Documentation provides every bit of information.
Here are the essential features of Docker:
Easy Modeling
Version control
Placement/Affinity
Application Agility
Developer Productivity
Operational Efficiencies
Some notable drawbacks of Docker are:
Doesn’t provide a storage option
Offer a poor monitoring option.
No automatic rescheduling of inactive Nodes
Complicated automatic horizontal scaling set up
The Docker image help to create Docker containers. You can create the Docker image with the
build command.
Docker daemon or Docker engine represents the server. The docker daemon and the clients
should be run on the same or remote host,
which can communicate through command-line client binary and full RESTful API.
Docker’s public registry is called Docker hub, which allows you to store images privately. In Docker
hub, you can store millions of images.
What command should you run to see all running container in Docker?
$ docker ps
Write the command to stop the docker container
$ sudo docker stop container name
What is the command to run the image as a container?
$ sudo docker run -i -t alpine /bin/bash
The common instruction in Dockerfile are: FROM, LABEL, RUN, and CMD.
Docker Swarm is native gathering for docker which helps you to a group of Docker hosts into a
single and virtual docker host.
Docker states and Docker Events are used to monitoring docker in the production environment.
Important states of Docker container are:
Running
Paused
Restarting
Exited
Docker hub is a cloud-based registry that which helps you to link to code repositories. It allows you
to build, test, store your image in Docker cloud.
Virtualization is a method of logically dividing mainframes to allow multiple applications to run
simultaneously.
docker info Information Command
docker pull Download an image
docker stats Container information
Docker images List of images downloaded
You can communicate between Docker client and Docker Daemon with the combination of Rest
API, socket.IO, and TCP.
How to use JSON instead of YAML compose file?
docker-compose -f docker-compose.json up
What is the command you need to give to push the new image to Docker registry?
docker push myorg/img
The Docker containers can be scaled to any level starting from a few hundred to even thousands
or millions of containers.
The only condition for this is that the containers need the memory and the OS at all times,
and there should not be a constraint when the Docker is getting scaled.
What is the method for creating a Docker container?
You can use any of the specific Docker images for creating a Docker container using the below
command.
docker run -t -i command name