DockerCompose Support Spec

Support Principle

DockerCompose is a sub-project in the Docker ecosystem. It proposes a specification for defining multiple container component guard startup parameters or construction methods. It is mainly used in stand-alone containerized environment scenarios, similar to systemd in a container environment. The multi-component components defined by DockerCompose restrict the communication mode and dependencies to only be deployed on a single machine, which is somewhat different from how Kubernetes handles components. How to make all the components defined by DockerCompose run in a Kubernetes cluster is the function provided by Kato to create components based on DockerCompose.

The user provides a DockerCompose definition file that can run normally. Kato will parse this file and read the key configuration of all internal components, including: component name, image name and repository address, environment variables, dependencies (startup sequence), persistence Storage and component ports. The Kato component abstraction is created based on these attributes, and then deployed in the underlying Kubernetes cluster through the management and operation mechanism of Kato’s component abstraction model. So as to realize the conversion of DockerCompose to Kubernetes.

The more critical one is the dependency relationship. The dependency relationship between components in DockerCompose uses Docker’s same network space principle, combined with Docker’s default DNS component to perform domain name resolution on dependent component aliases to achieve communication between components. This mode cannot be implemented directly in the Kubernetes scenario, but based on Kato’s default ServiceMesh mechanism, it has achieved the same effect. The Kato dns component will resolve component aliases to When components access other components through aliases, they are actually Access the local agent of the component, and the local ServiceMesh Sidecar container completes dynamic component discovery and load balancing. From the effect, it is consistent with the stand-alone DockerCompose, but in fact the entire application is already running in a distributed environment in a cluster, and each component can run multiple instances.

Creation Method and Precautions

In the team view, you can enter the DockerCompose creation process through Create --> Create components based on images --> Select DockerCompose. Since DockerCompose creates a complete application (containing N components), a new application must be created and specified when creating it.

There are the following points to note

  1. If there is information that needs to read environment variables in the DockerCompose configuration, please manually complete the changes first. Kato does not support dynamic rendering of DockerCompose configuration based on environment variables.
  2. Make sure that the DockerCompose configuration in yaml format is correct, otherwise the test will fail.
  3. During the detection process, Kato will use the mirror information to resolve the mirror repository address and generate a request to verify whether the mirror exists. Only when all the verification tests are passed will it pass. In versions prior to 5.1.3, the verification method was to pull mirror directly, so the detection process took a long time.
  4. In 5.1.3 and later versions, Kato will only read attributes from the DockerCompose configuration, and no longer parse attributes from the mirror. Try to explicitly configure useful attribute information (environment variables, ports, storage).

Mirror Repository Account Password Setting

Overall Setting

You can add the mirror repository account password in the DockerCompose form setting. This setting will take effect on all mirrors in this DockerCompose. If individual mirrors do not require account passwords or have different accounts, please use separate settings.

Set Separately

Separate setting refers to adding special environment variables for each component in the DockerCompose configuration to define the mirror repository account password of the current component image. The setting method is:

HUB_USER set account

HUB_PASSWORD set password

Note: When the two methods exist at the same time, the priority of each setting is higher than the overall setting.