In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge about "Docker container definition tools". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
1. Container specification
Containers are not just Docker, there are other containers, such as rkt for CoreOS. In order to ensure the healthy development of the container ecosystem and ensure compatibility between different containers, several companies including Docker, CoreOS and Google have jointly established an organization called the Open Container Initiative (OCI), which aims to develop open container specifications.
2. Container runtime
Runtime is where the container actually runs. The runtime needs to work closely with the operating system kernel to provide a runtime environment for containers.
Lxc, runc and rkt are the three main container runtimes.
lxc is an old-fashioned container runtime on Linux. Docker originally used lxc as its runtime.
runc is Docker's own container runtime, which conforms to the oci specification and is now Docker's default runtime.
rkt is a container runtime developed by CoreOS that conforms to the oci specification and is therefore capable of running Docker containers.
3. Container management tools
Runtime isn't enough; users need tools to manage containers. Container management tools interact internally with runtime and provide interfaces to users externally, such as CLI. This is like providing java commands in addition to JVM so that users can start and stop applications.
Lxd is the management tool corresponding to lxc.
Runc's management tool is docker engine. Docker engine consists of two parts: deamon and cli. We usually refer to Docker, which generally means docker engine.
Rkt's management tool is rkt cli.
4. Container definition tool
The Container Definition Tool allows users to define the contents and attributes of containers so that containers can be saved, shared, and rebuilt.
docker image is a template for docker container, runtime creates container from docker image.
Dockerfile is a text file containing several commands from which a docker image can be created.
ACI (App Container Image) is similar to docker image except it is an image format of rkt container developed by CoreOS.
5、Registry
Containers are created through images, and a repository is needed to store images uniformly. This repository is called Registry.
Docker Hub (https://hub.docker.com) is Docker's hosted Registry for the public, which has a lot of ready-made images, providing great convenience for Docker users.
Quay.io (https://quay.io/) is another publicly hosted Registry that provides a service similar to Docker Hub.
6. Container OS
Because of container runtimes, almost all Linux, MAC OS, and Windows can run containers. But that didn't stop the container OS from coming out.
A container OS is an operating system that runs containers exclusively. Container OS is generally smaller and starts faster than regular OS. Because OS is customized for containers, they are generally more efficient at running containers.
There are already quite a few container OSs, CoreOS, atomic and ubuntu core are outstanding representatives.
Second, talk about containers.
1 What is a container?
Containers are lightweight, portable, self-contained software packaging technologies that enable applications to run the same way almost anywhere. Developers create and test containers on their own laptops that run on virtual machines, physical servers, or public cloud hosts on production systems without any modifications.
Containers vs. virtual machines
Containers run in user space of the Host operating system, isolated from other processes of the operating system. This is significantly different from the virtual machine.
Traditional virtualization technologies, such as VMWare, KVM, Xen, aim to create complete virtual machines. In order to run an application, in addition to deploying the application itself and its dependencies (usually tens of MB), the entire operating system (a few GB) has to be installed.
Difference between virtual machines and containers
Since all containers share the same Host OS, this makes containers much smaller in size than virtual machines. In addition, starting containers does not require booting the entire operating system, so container deployment and startup are faster, less expensive, and easier to migrate.
2. Why use containers
Systems today are architecturally much more complex than they were a decade ago. Previously, almost all applications used a three-tier architecture (Presentation/Application/Data), with systems deployed to a limited number of physical servers (Web Server/Application Server/Database Server).
Today, developers typically build and assemble applications using multiple services (such as MQ, Cache, DB), and applications are likely to be deployed to different environments, such as virtual servers, private clouds, and public clouds.
On the one hand, applications contain multiple services, which have their own libraries and software packages on which they depend; on the other hand, there are multiple deployment environments, and services may need to be dynamically migrated to different environments at runtime. This raises a question:
How do you make each service work in all deployment environments?
Clever technicians have found answers in the traditional transportation industry.
Decades ago, the transportation industry faced similar problems.
Every shipment, shippers and carriers worry about losses due to different types of goods, such as several iron drums mistakenly pressed on a pile of bananas. On the other hand, the need to use different means of transportation in the transportation process also makes the whole process painful: goods are loaded into cars, transported to the dock, unloaded, loaded into ships, unloaded from ships when they arrive, loaded into trains, arrived at their destinations, and finally unloaded. More than half of the time spent on loading and unloading, and moving up and down is also easy to damage the goods.
Fortunately, the invention of the container solved this problem.
For example, containers (containers) are important for ocean transportation (application operations). Containers can protect goods (applications) from collision (application collision) and damage, and can also ensure that when some dangerous goods have a small explosion (application collapse), it will not affect other goods (applications). But loading goods (applications) in containers (containers) is not a simple matter. The Docker solved this problem. Docker makes it easy to load goods into containers. For ocean transportation (application operation), using multiple small cargo ships (virtual machines) instead of the original large cargo ships (physical machines) can also ensure the safety of goods (applications), but compared with containers (containers), the cost is too high, but it is suitable for transporting certain important goods (applications).
Any cargo, whether pianos or porsches, is put into its own container. The container is sealed throughout the journey and opened only when it reaches its final destination. Standard containers can be efficiently loaded, stacked and transported over long distances. Modern cranes automatically move containers between trucks, ships and trains. Container is regarded as the most important invention of transportation industry and world trade.
Docker applies container thinking to software packaging, providing a container-based standardized shipping system for code. Docker packages any application and its dependencies into a lightweight, portable, self-contained container. Containers can run on almost any operating system.
In fact, the English words corresponding to "container" and "container" are both "Container."
"Container" is a common name in China, probably because containers are more abstract than containers and more suitable for software field.
3. Advantages of containers
for developers
Containers imply environmental isolation and repeatability. Developers only need to create a runtime environment for their app once, then package it into containers to run on other machines. In addition, the container environment is isolated from the Host environment, just like the virtual machine, but faster and simpler.
For operation and maintenance personnel
A server can run any container simply by configuring a standard runtime environment. This makes the operations staff's work more efficient, consistent and repeatable. Containers eliminate inconsistencies in development, test, and production environments.
"Docker container definition tools what" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.