Table of contents
- Difference between Image, Container, and Engine:
- Difference between Docker command COPY vs ADD:
- Difference between Docker command CMD vs RUN:
- How to reduce the size of the Docker image:
- Why and when to use Docker:
- Explanation of Docker components and how they interact with each other:
- Explanation of Docker terminology:
- Real scenarios where Docker is used:
- Docker vs Hypervisor:
- Advantages and disadvantages of using Docker:
- Dcker namespace:
- Docker registry:
- Entry point:
- CI/CD in Docker:
- Will data on the container be lost when the Docker container exits:
- Docker swarm:
- Docker commands:
Difference between Image, Container, and Engine:
Docker Image is a template that contains all the dependencies required to run an application. Docker Container is a running instance of a Docker Image. Docker Engine is the core component of the Docker platform that manages the Docker Images and Containers.
Difference between Docker command COPY vs ADD:
Both COPY and ADD can be used to copy files from the host machine to the Docker Image. The difference is that ADD can also download files from URLs, and it can automatically unpack compressed files. COPY is a simpler command that only copies files from the host machine.
Difference between Docker command CMD vs RUN:
RUN is used to execute a command during the Docker Image build process. CMD is used to specify the default command to be executed when a Docker Container is started from the Docker Image.
How to reduce the size of the Docker image:
Some common practices to reduce the size of the Docker Image are to use a smaller base image, remove unnecessary files and dependencies, and combine multiple RUN commands into a single command.
Why and when to use Docker:
Docker is used to creating a lightweight and portable environment to run applications, regardless of the underlying infrastructure. It is particularly useful in scenarios where there are many dependencies, and the environment needs to be consistent across different environments.
Explanation of Docker components and how they interact with each other:
Docker Compose is a tool for defining and running multi-container Docker applications. Docker File is a script that contains a set of instructions to build a Docker Image. Docker Image is a template that contains all the dependencies required to run an application. Docker Container is a running instance of a Docker Image. Docker Engine is the core component of the Docker platform that manages the Docker Images and Containers.
Explanation of Docker terminology:
Docker Compose is a tool for defining and running multi-container Docker applications. Docker File is a script that contains a set of instructions to build a Docker Image. Docker Image is a template that contains all the dependencies required to run an application. Docker Container is a running instance of a Docker Image.
Real scenarios where Docker is used:
Docker is commonly used for application deployment, testing, and development. It is also used for running microservices and containerizing legacy applications.
Docker vs Hypervisor:
Docker is a containerization technology that runs applications in isolated environments. Hypervisors are virtualization technologies that run entire operating systems in virtual machines.
Advantages and disadvantages of using Docker:
The advantages of using Docker include portability, consistency, and scalability. Disadvantages include the potential for security vulnerabilities and the learning curve for new users.
Dcker namespace:
Docker namespace is a mechanism for ensuring that Docker Images and Containers have unique names to avoid conflicts.
Docker registry:
The Docker registry is a repository for storing and distributing Docker Images.
Entry point:
The entry point is a Docker directive that specifies the command to be run when a Docker Container is started from a Docker Image.
CI/CD in Docker:
CI/CD in Docker can be implemented by using a Dockerfile to define the application build process and using Docker Compose to orchestrate the deployment of multiple containers.
Will data on the container be lost when the Docker container exits:
By default, data on the container is lost when the Docker container exits. However, data can be persisted by mounting a volume to the container.
Docker swarm:
Docker swarm is a tool for orchestrating the deployment and management of multiple Docker containers across multiple hosts.
Docker commands:
View running containers: docker ps
Command to run the container under a specific name: docker run --name <name> <image>
Command to export a Docker: docker export