github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/docs/site/src/zh/getting-started/build-appimage.md (about)

     1  # Build application image
     2  
     3  ## Motivations
     4  
     5  Applications image contains applications with all dependencies except the base image, so applications image can install
     6  to an already existing Kubernetes cluster. with applications image, cluster can be incremental updating, and we can
     7  install applications to an already existing Kubernetes cluster.
     8  
     9  ## Use cases
    10  
    11  ### Build an application image
    12  
    13  just add argument "--base=false", will build an application image. and the size of application image depends on the
    14  docker image size in most cases. without rootfs,it will become slimmer.
    15  
    16  For example to build a prometheus application image:
    17  Kubefile:
    18  
    19  ```shell
    20  FROM registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-localpv:2.11.0
    21  COPY prometheus manifests
    22  CMD kubectl apply -f prometheus/crd.yaml
    23  CMD kubectl apply -f prometheus/operator.yaml
    24  ```
    25  
    26  build command:
    27  
    28  ```shell
    29  sealer build -f Kubefile -t prometheus:2.30.0 --base=false .
    30  ```
    31  
    32  The image prometheus:2.30.0 will not contain the embedded Kubernetes cluster. and it only contains all the docker image
    33  that application needs, and contains helm chart or other operator manifests.
    34  
    35  ### Apply this application image
    36  
    37  We can only support sealer cluster currently. Sealer hacked docker and registry to cache docker image in cluster, so if
    38  cluster not installed by sealer, this app image will install failed.
    39  
    40  ```shell
    41  sealer run prometheus:2.30.0
    42  ```
    43  
    44  Or using Clusterfile to overwrite the config files like helm values.
    45  
    46  ### Merge two application images
    47  
    48  Using sealer merge ,we can combine the app image as one,in the meantime we can merge application images with cloud
    49  images.
    50  
    51  ```shell
    52  sealer merge mysql:8.0.26 redis:6.2.5 -t mysql-redis:latest
    53  ```