In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Docker image is a special file system, which not only provides programs, libraries, resources, configuration and other files needed by the container, but also contains some configuration parameters (such as anonymous volumes, environment variables, users, etc.) prepared for the runtime. The mirror does not contain any dynamic data, and its content will not be changed after it is built. When Docker is designed, it makes full use of the technology of Union FS and designs it as a hierarchical storage architecture. Mirroring is actually made up of multi-tier file systems. When the image is built, it is built layer by layer, and the former layer is the foundation of the latter layer. After each layer is built, there will be no change, and any change on the latter layer will only happen at your own level. For example, deleting a file in the previous layer does not actually delete the file in the previous layer, but only marks the file as deleted at the current layer. Although the file will not be seen when the final container runs, it will actually follow the image all the time. Therefore, when building the image, you need to be extra careful, each layer contains only what needs to be added by that layer, and any extra stuff should be cleaned up before the end of the layer construction. The characteristics of hierarchical storage also make the reuse and customization of images easier. You can even use the previously built image as the base layer, and then further add new layers to customize the content you need and build a new image.
The relationship between Image and Container is like classes and instances in object-oriented programming. Mirrors are static definitions and containers are entities that mirror runtime. Containers can be created, started, stopped, deleted, paused, and so on. A container is essentially a process, but unlike a process executed directly in the host, the container process runs in its own independent namespace. As mentioned earlier, mirrors use tiered storage, and so do containers. The life cycle of the container storage layer is the same as that of the container. When the container dies, the container storage layer also dies. Therefore, any information saved in the container storage layer is lost when the container is deleted. As required by Docker best practices, the container should not write any data to its storage tier, and the container storage tier should remain stateless. All file writing operations should use data volumes (Volume) or bind host directories. Reads and writes at these locations will skip the container storage layer and read and write directly to the host (or network storage), resulting in higher performance and stability. The life cycle of the data volume is independent of the container, the container dies, and the data volume does not die. Therefore, after using the data volume, the container can delete and re-run at will without losing the data.
After the image is built, it can easily run on the current host, but if you need to use this image on other servers, we need a centralized service to store and distribute images, such as Docker Registry. A Docker Registry can contain multiple repositories (Repository); each warehouse can contain multiple tags (Tag); each tag corresponds to an image. So: the image repository is the place where Docker centrally stores image files, similar to the code repository we used before. Usually, a repository will contain images of different versions of the same software, and tags are often used to correspond to different versions of the software. We can specify which version of the software is mirrored by the format of:. If no label is given, latest will be used as the default label. The most commonly used Registry public service is the official Docker Hub, which is also the default Registry, and has a large number of high-quality official images. In addition to using public services, users can also build private Docker Registry locally. Docker officially provides Docker Registry image, which can be used directly as a private Registry service. The open source Docker Registry image only provides a server-side implementation of Docker Registry API, which is sufficient to support docker commands without affecting the use. However, it does not include graphical interface, as well as advanced functions such as image maintenance, user management, access control and so on.
Neusoft SaCa Aclome cloud management platform supports cloud management
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.