search
HomeOperation and MaintenanceDockerWhat is the docker ecosystem?

What is the docker ecosystem?

May 11, 2022 pm 02:49 PM
docker

The ecosystem includes: 1. Docker Hub, which is an official resource for pre-written Dockerfiles and provides public and private image repositories; 2. Docker Engine, the core software used to run and manage containers; 3 , Kitematic, is a visual management tool; 4. Machine and Swarm, provide a simple set of tools for various virtualization and cloud service providers to move and scale their local projects; 5. Compose; 6. Cloud ; 7. Center.

What is the docker ecosystem?

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

Docker is a tool for creating "containers" that contain only what you need for an independent application or technology stack. Unlike virtual machines, these containers share the same resources to manage the interaction between the container and the host. This makes Docker containers fast, lightweight, secure, and shareable.

The currently available Docker ecosystem includes: Docker Hub, Docker Engine, Kitematic, Docker Machine, Swarm, Docker Compose, Dokcer Cloud and Data Center. The functions of these tools will be introduced in detail below. , and how these tools can be better combined.

Docker Hub

The core of any project using Docker is a Dockerfile file. This file contains instructions for how Docker creates an image. Let's look at a simple example:

FROM python:2.7
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt

In this example, the Dockerfile pulls a specific version of the existing image, copies the current local directory into the container's file system, sets it as the working directory, and then uses the pip command Download Python dependencies from a text file.

Docker Hub is an official resource for pre-written Dockerfiles, providing public (free) and private (paid) image repositories. If you're looking for a Dockerfile to meet your needs, start by searching on Docker Hub and use the project documentation, downloads, and image ratings to help guide your decision.

What is the docker ecosystem?

Docker Engine

Docker Engine is used to run and manage containers core software. Often people refer to it simply as Docker or the Docker Platform. The Docker engine consists of many specialized tools working together to create and run containers, such as APIs, execution drivers, runtimes, shims, etc.

Docker Engine creates Dockerfile files and converts them into usable containers. Docker Engine is the core of Docker. Without Docker Engine, nothing can run. There are several ways to download Docker Engine depending on your operating system. You can Discover more details here .

To start a container based on an image in Docker Hub, you should first pull the image and run it. Continuing with the Python example:

docker pull python
docker run -it --rm --name script-name -v "$PWD":/usr/src/appname -w /usr/src/appname python:3 python app.py

This will pull the latest Python image and then open a container to run a Python script and exit the container after running. The run command provides more option settings, you can Read the complete guide here .

When a Docker run command starts to become more complex, it may be a better idea to create your own custom Dockerfile. Start a container based on a local Dockerfile and run the following directory containing the files:

docker build -t my_image .

This command will create an image named my_image. Run the following command to start a container based on this image:

docker run -name my_image_container -i -t my_image

This command will open a container based on the custom my_image image. This container is named my_image_container.

Kitematic (Docker visual management tool)

对于那些宁愿避免命令行的用户来说,  Kitematic  是一个 Docker GUI 工具,它可以更快速、更简单的运行Docker容器,现在已经支持 Mac /Windows/Linux。

搜索你需要的镜像,创建一个容器,你最好去Kitematic。Kitematic提供了基本的配置选项,但对于更高级的设置,你可能需要进入命令行。   

What is the docker ecosystem?

你的容器出现在左手边,在那里它们可以被启动、停止、重启,更有用的是,你可以在那里找到容器日志和直接SSH(exec按键)访问。   

What is the docker ecosystem?

Docker Machine和Swarm

生产中使用Docker的第一步是了解  Machine  和Swarm,它们为各种虚拟化和云服务提供商提供了一套简单的工具集用以移动和缩放他们的本地项目。  

“生产中使用Docker的第一步是了解Machine和Swarm。”  

例如,在Azure上创建一个Docker实例:  

docker-machine create -d azure --azure-subscription-id="XXX" --azure-subscription-cert="/mycert.pem" ecodemo

这个命令使用预装的Docker创建一个Ubuntu 12.04-based虚拟机并命名为ecodemo。每个供应商都需要不同的参数和认证方法,这些默认设置可以被重写。在  这个文档  中可以阅读到更多的细节。   

当与  Swarm  结合后,Machine可以创建Docker实例的集群,这个集群被视为一个单一的、大的Docker实例。每一个Swarm集群都需要一个master实例,这个master实例可以用下面的命令来创建:  

docker-machine create
-d virtualbox
--swarm
--swarm-master
--swarm-discovery token://TOKEN_ID
swarm-master

这样就会在VirtualBox中创建一个Docker实例并且设置这个Docker实例为Swarm集群的一个master节点。TOKEN_ID非常重要,因为它可以帮助集群中的所有节点识别彼此。除了手动创建TOKEN_ID标识以外,Swarm也有  发现系统  来帮助你管理这个过程。 

下面的命令使用相同的TOKEN_ID标识添加Docker实例到Swarm集群:  

docker-machine create
-d virtualbox
--swarm
--swarm-discovery token://TOKEN_ID
swarm-node-n

swarm-node-n对于集群中的每一个节点来说都是一个唯一的名字。   

现在,代替从单个虚拟机中开启容器,你可以在集群中开启容器,master节点将会把这个容器分配给最可用的和最有能力的节点。 

Docker Compose

Compose  使得由多个组件(像容器)组成的应用程序更加简单,你可以开始使用一个命令在一个单一的配置文件中声明所有这些组件。   

下面是一个Compose文件(称为docker-compose.yml)的例子,这个例子创建三个  Crate  数据库实例和一个  Laravel  (用一些额外的配置)PHP框架实例。最重要的是,容器与Links配置选项相连。  

crate1:
image: crate
ports:
- "4200:4200"
- "4300:4300"
crate2:
image: crate
crate3:
image: crate
volumes:
- ./data:/importdata
laravelcomposer:
image: dylanlindgren/docker-laravel-composer
volumes:
- /laravel-application:/var/www
command: --working-dir=/var/www install
links:
- crate1
laravelartisan:
image: dylanlindgren/docker-laravel-artisan
links:
- crate1
volumes_from:
- laravelcomposer
working_dir: /var/www
command: serve --host=0.0.0.0:8080
ports:
- "8000:8000"
- "8080:8080"

所有这些实例和它们的配置现在可以通过运行以下在同一目录中的docker-compose.yml文件的命令来开始:  

docker-compose up

What is the docker ecosystem?

你可以使用相同的子命令作为Docker的命令来影响所有以docker-compose开始的容器。例如,docker-compose stop命令可以停止以docker-compose开始的容器。   

What is the docker ecosystem?

Docker Cloud

容器的自动化管理和编排是Docker的主要功能,但却一直由第三方服务来提供,直到去年Docker获得了  Tutum(它支撑着Docker云)  。虽然没有完整的命令行工具(还没有),Docker云服务允许Docker Compose文件设置应用程序栈,所以它不是来自于生态型的其它部分的一个大的导流。  

“容器的自动化管理是Docker的重要组成,但知道最近一直由第三方来提供。”  

例如:  

crate1:
image: crate
ports:
- "4200:4200"
- "4300:4300"
command: crate -Des.network.publish_host=_ethwe:ipv4_
crate2:
image: crate
command: crate -Des.network.publish_host=_ethwe:ipv4_
crate3:
image: crate
command: crate -Des.network.publish_host=_ethwe:ipv4_

这样就创建了同一个镜像的三个实例,其中一个手动设置主机与Docker之间的端口分配,其他的端口分配是自动的。我将很快重新访问command。   

如果你想在超过一个节点(节点能够运行它可以管理的足够多的容器和一个私有仓库上扩展应用程序,Docker Cloud是有偿服务。这对于实验目的来说足够了。记住,Docker Cloud默认管理托管在第三方托管服务器上的容器,所以你也需要支付费用。使得Docker Cloud代理运行在任何你管理的Linux主机上是可能的,你可以  在这里找到操作指南  。   

What is the docker ecosystem?

上面的截图显示了三个使用预先设定的规则运行在跨越两个数字海洋的实例上的Docker容器,这个预先设定的规则是根据你设置的参数来将容器分配给主机。它会自动确保你指定数量的容器始终在运行。   

在之前的Docker Compose例子中,你可能已经注意到_ethwe:ipv4_。这是Docker Cloud的另外一个重要特征。许多分布式应用和服务依赖“  服务发现  ”来找到同一服务的其他实例并进行通信。当在数据中心和物理机器上传播服务时,这往往需要实例的手动说明或者需要另一种方式来找到彼此。   

Docker Cloud包括支持  Weave  在你的实际网络中创建一个“软”网络;所有的容器和应用都可以发现彼此,无论它们被托管在哪里。在上面的例子中,我们重写了向容器发出的默认命令,以确保它接收它需要使用此功能的信息。  

Data Center

到目前为止,本文涉及的大部分工具都是你安装,主机,和支持的工具。对企业用户来说,他们寻找安全性、性能和支持较高的保证,Docker提供了  数据中心  。   

它使用了覆盖这里的许多相同的工具包,但是增加了一个放置你的镜像的私有仓库,一个私有云,高级支持,和供应商可能吸引企业用户的第三方集成。这些包括LDAP and Active Directory用户管理,容器检测,和日志记录。  

推荐学习:《docker视频教程

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

Statement
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
The Power of Docker: Containerization ExplainedThe Power of Docker: Containerization ExplainedMay 07, 2025 am 12:07 AM

Docker simplifies the construction, deployment and operation of applications through containerization technology. 1) Docker is an open source platform that uses container technology to package applications and their dependencies to ensure cross-environment consistency. 2) Mirrors and containers are the core of Docker. The mirror is the executable package of the application and the container is the running instance of the image. 3) Basic usage of Docker is like running an Nginx server, and advanced usage is like using DockerCompose to manage multi-container applications. 4) Common errors include image download failure and container startup failure, and debugging skills include viewing logs and checking ports. 5) Performance optimization and best practices include mirror optimization, resource management and security improvement.

Kubernetes and Docker: Deploying and Managing Containerized AppsKubernetes and Docker: Deploying and Managing Containerized AppsMay 06, 2025 am 12:13 AM

The steps to deploy containerized applications using Kubernetes and Docker include: 1. Build a Docker image, define the application image using Dockerfile and push it to DockerHub. 2. Create Deployment and Service in Kubernetes to manage and expose applications. 3. Use HorizontalPodAutoscaler to achieve dynamic scaling. 4. Debug common problems through kubectl command. 5. Optimize performance, define resource limitations and requests, and manage configurations using Helm.

Docker: An Introduction to Containerization TechnologyDocker: An Introduction to Containerization TechnologyMay 05, 2025 am 12:11 AM

Docker is an open source platform for developing, packaging and running applications, and through containerization technology, solving the consistency of applications in different environments. 1. Build the image: Define the application environment and dependencies through the Dockerfile and build it using the dockerbuild command. 2. Run the container: Use the dockerrun command to start the container from the mirror. 3. Manage containers: manage container life cycle through dockerps, dockerstop, dockerrm and other commands.

Docker and Linux: Building Portable ApplicationsDocker and Linux: Building Portable ApplicationsMay 03, 2025 am 12:17 AM

How to build portable applications with Docker and Linux? First, use Dockerfile to containerize the application, and then manage and deploy the container in a Linux environment. 1) Write a Dockerfile and package the application and its dependencies into a mirror. 2) Build and run containers on Linux using dockerbuild and dockerrun commands. 3) Manage multi-container applications through DockerCompose and define service dependencies. 4) Optimize the image size and resource configuration, enhance security, and improve application performance and portability.

Docker and Kubernetes: The Power of Container OrchestrationDocker and Kubernetes: The Power of Container OrchestrationMay 02, 2025 am 12:06 AM

Docker and Kubernetes improve application deployment and management efficiency through container orchestration. 1.Docker builds images through Dockerfile and runs containers to ensure application consistency. 2. Kubernetes manages containers through Pod, Deployment and Service to achieve automated deployment and expansion.

Docker vs. Kubernetes: Key Differences and SynergiesDocker vs. Kubernetes: Key Differences and SynergiesMay 01, 2025 am 12:09 AM

Docker and Kubernetes are leaders in containerization and orchestration. Docker focuses on container lifecycle management and is suitable for small projects; Kubernetes is good at container orchestration and is suitable for large-scale production environments. The combination of the two can improve development and deployment efficiency.

Docker and Linux: The Perfect PartnershipDocker and Linux: The Perfect PartnershipApr 30, 2025 am 12:02 AM

Docker and Linux are perfect matches because they can simplify the development and deployment of applications. 1) Docker uses Linux's namespaces and cgroups to implement container isolation and resource management. 2) Docker containers are more efficient than virtual machines, have faster startup speeds, and the mirrored hierarchical structure is easy to build and distribute. 3) On Linux, the installation and use of Docker is very simple, with only a few commands. 4) Through DockerCompose, you can easily manage and deploy multi-container applications.

Docker vs. Kubernetes: Deciding Which to UseDocker vs. Kubernetes: Deciding Which to UseApr 29, 2025 am 12:05 AM

The difference between Docker and Kubernetes is that Docker is a containerized platform suitable for small projects and development environments; Kubernetes is a container orchestration system suitable for large projects and production environments. 1.Docker simplifies application deployment and is suitable for small projects with limited resources. 2. Kubernetes provides automation and scalability capabilities, suitable for large projects that require efficient management.

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)