Table of Contents
What docker containers are used for
Home Operation and Maintenance Docker What are docker containers used for?

What are docker containers used for?

Feb 23, 2022 am 11:21 AM
docker

In docker, containers provide an efficient mechanism for combining components into application and service stacks and keeping software components updated and maintained; docker containers are not only isolated from each other, but also from the underlying System isolation and can run on any machine that supports container runtime environments.

What are docker containers used for?

The operating environment of this tutorial: linux7.3 system, docker-1.13.1 version, Dell G3 computer.

What docker containers are used for

One of the goals of modern software development is that applications can both run on the same host or cluster and be isolated from each other so that they do not Unduly interfere with each other's operation or maintenance, but this becomes more difficult due to running packages, libraries, and other software components.

One solution to this problem is to use a virtual machine, which completely isolates applications on the same hardware and minimizes conflicts between software components and competition between hardware resources, but virtual machines The machine size is relatively large, and each virtual machine requires its own operating system, so it is usually GB in size and difficult to maintain and upgrade.

Contrary to virtual machines, containers isolate application execution environments from each other but share the underlying OS kernel. They are typically measured in megabytes, use far fewer resources than virtual machines, and start almost instantly. It is possible to pack more densely on the same hardware without much effort and overhead.

Containers provide an efficient and highly granular mechanism to combine software components into the various application and service stacks required by modern enterprises, and to keep these software components updated and maintained.

Docker is an open source project that makes it easy to create containers and container-based applications. Originally built for Linux, it now also runs on Windows and MacOS.

Docker has always been able to help developers quickly build lightweight and portable software containers, thereby simplifying application development, testing and deployment. Specifically, it is a software platform for building applications that provides a small and lightweight execution environment that shares the operating system kernel but otherwise runs independently.

Although the concept of containers has been around for a long time, the open source project Docker launched in 2013 has largely helped popularize this technology and promoted the trend of containerization and microservices in software development. This trend came to be known as cloud-native development.

Docker containers provide a way to build enterprise applications and business process applications that are easier to install, maintain, and move than traditional applications.

Docker containers support isolation: Docker containers enable applications to be isolated not only from each other, but also from the underlying system. This not only makes the software stack cleaner, but also makes it easier for containerized applications to use system resources such as CPU, GPU, memory, I/O, network, etc. It also ensures that data and code remain independent.

Docker containers support portability: Docker containers run on any machine that supports the container runtime environment. Applications do not have to be tied to the host operating system, so the application environment and underlying operating environment can be kept clean and minimal.

For example, MySQL with containers will run on most Linux systems that support containers, and all of the application's dependencies are typically provided in the same container. Container-based applications can be easily moved from an on-prem system to a cloud environment, or from a developer's laptop to a server, as long as the target system supports Docker and any third-party tools that may be used with it, such as Kubernetes.

Typically, Docker container images must be built for a specific platform. For example, Windows containers cannot run on Linux, and vice versa; previously, one way to get around this limitation was to launch a virtual machine running an instance of the desired operating system and run the container within the virtual machine.

However, the Docker team later designed a more elegant solution called manifest, which allows images of multiple operating systems to be packaged in parallel. Although the manifest is still in the experimental stage, it hints that containers may become a cross-platform application solution and a cross-environment application solution.

Docker containers support composability: most business applications are composed of several independent components, web servers, databases and cache caches. Docker containers can combine these components into an easily replaceable functional unit. Each part is served by a different container and can be maintained, updated, exchanged, and modified independently of other containers.

This is essentially the microservices model for application design. By dividing application functionality into independent, self-contained services, the microservices model provides a solution to the slow process of traditional development and monolithic rigid applications. Lightweight and portable containers enable building and maintaining microservices-based application just got easier.

Docker containers simplify orchestration and scaling: because containers are lightweight and have little overhead, more containers can be launched on a given system, and containers can also be used in cross-system clusters Scale applications and scale services up or down to meet peak demand or conserve resources.

Most enterprise-grade versions of tools for deploying, managing, and scaling containers are provided through third-party projects. Chief among them is Google's Kubernetes, an automated system that supports container deployment and scaling, as well as container connectivity, load balancing, and management. Kubernetes also provides ways to create and reuse multi-container applications or "Helm charts" so that complex application stacks can be built and managed as needed.

Docker also has a built-in Swarm orchestration mode. Currently, this mode is rarely used, and Kubernetes has become a default choice. In fact Kubernetes is bundled with Docker Enterprise Edition.

Recommended learning: "docker video tutorial"

The above is the detailed content of What are docker containers used for?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use docker desktop How to use docker desktop Apr 15, 2025 am 11:45 AM

How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

How to change the docker image source in China How to change the docker image source in China Apr 15, 2025 am 11:30 AM

You can switch to the domestic mirror source. The steps are as follows: 1. Edit the configuration file /etc/docker/daemon.json and add the mirror source address; 2. After saving and exiting, restart the Docker service sudo systemctl restart docker to improve the image download speed and stability.

How to create a mirror in docker How to create a mirror in docker Apr 15, 2025 am 11:27 AM

Steps to create a Docker image: Write a Dockerfile that contains the build instructions. Build the image in the terminal, using the docker build command. Tag the image and assign names and tags using the docker tag command.

How to read the docker version How to read the docker version Apr 15, 2025 am 11:51 AM

To get the Docker version, you can perform the following steps: Run the Docker command "docker --version" to view the client and server versions. For Mac or Windows, you can also view version information through the Version tab of the Docker Desktop GUI or the About Docker Desktop menu.

How to build a private repository by docker How to build a private repository by docker Apr 15, 2025 am 11:06 AM

You can build Docker private repositories to securely store and manage container images, providing strict control and security. The steps include: creating a repository, granting access, deploying a repository, pushing an image, and pulling an image. Advantages include security, version control, reduced network traffic and customization.

How to call docker lnmp How to call docker lnmp Apr 15, 2025 am 11:15 AM

Docker LNMP container call steps: Run the container: docker run -d --name lnmp-container -p 80:80 -p 443:443 lnmp-stack to get the container IP: docker inspect lnmp-container | grep IPAddress access website: http://<Container IP>/index.phpSSH access: docker exec -it lnmp-container bash access MySQL: mysql -u roo

How to run the docker command How to run the docker command Apr 15, 2025 am 11:24 AM

How to run Docker commands? Install Docker and start the daemon. Common Docker commands: docker images: display image docker ps: display container docker run: run container docker stop: stop container docker rm: delete container interact with container using Docker command: docker exec: execute command docker attach: attach console docker logs: display log docker commit: commit change to mirror stop Docker daemon: sudo systemctl stop doc

How to save docker image How to save docker image Apr 15, 2025 am 11:54 AM

To save the image in Docker, you can use the docker commit command to create a new image, containing the current state of the specified container, syntax: docker commit [Options] Container ID Image name. To save the image to the repository, you can use the docker push command, syntax: docker push image name [: tag]. To import saved images, you can use the docker pull command, syntax: docker pull image name [: tag].

See all articles