github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/docs/site/src/zh/reference/cloudrootfs.md (about)

     1  # What is CloudRootfs
     2  
     3  All the files witch run a kubernetes cluster needs.
     4  
     5  Contains:
     6  
     7  * Bin files, like docker containerd crictl kubeadm kubectl...
     8  * Config files, like kubelet systemd config, docker systemd config, docker daemon.json...
     9  * Registry docker image
    10  * Some Metadata, like Kubernetes version.
    11  * Registry files, contains all the docker image, like kubernetes core component docker images...
    12  * Scripts, some shell script using to install docker and kubelet... sealer will call init.sh and clean.sh.
    13  * Other static files
    14  
    15  ```yaml
    16  .
    17  ├── bin
    18  │   ├── conntrack
    19  │   ├── containerd-rootless-setuptool.sh
    20  │   ├── containerd-rootless.sh
    21  │   ├── crictl
    22  │   ├── kubeadm
    23  │   ├── kubectl
    24  │   ├── kubelet
    25  │   ├── nerdctl
    26  │   └── seautil
    27  ├── cri
    28  │   ├── containerd
    29  │   ├── containerd-shim
    30  │   ├── containerd-shim-runc-v2
    31  │   ├── ctr
    32  │   ├── docker
    33  │   ├── dockerd
    34  │   ├── docker-init
    35  │   ├── docker-proxy
    36  │   ├── rootlesskit
    37  │   ├── rootlesskit-docker-proxy
    38  │   ├── runc
    39  │   └── vpnkit
    40  ├── etc
    41  │   ├── 10-kubeadm.conf
    42  │   ├── Clusterfile  # image default Clusterfile
    43  │   ├── daemon.json
    44  │   ├── docker.service
    45  │   ├── kubeadm-config.yaml
    46  │   └── kubelet.service
    47  ├── images
    48  │   └── registry.tar  # registry docker image, will load this image and run a local registry in cluster
    49  ├── Kubefile
    50  ├── Metadata
    51  ├── README.md
    52  ├── registry # will mount this dir to local registry
    53  │   └── docker
    54  │       └── registry
    55  ├── scripts
    56  │   ├── clean.sh
    57  │   ├── docker.sh
    58  │   ├── init-kube.sh
    59  │   ├── init-registry.sh
    60  │   ├── init.sh
    61  │   └── kubelet-pre-start.sh
    62  └── statics # yaml files, sealer will render values in those files
    63      └── audit-policy.yml
    64  ```
    65  
    66  ## How can I get CloudRootfs
    67  
    68  1. Pull a BaseImage `sealer pull kubernetes:v1.19.8-alpine`
    69  2. View the image layer information `sealer inspect kubernetes:v1.19.8-alpine`
    70  3. Get into the BaseImage Layer `ls /var/lib/sealer/data/overlay2/{layer-id}`
    71  
    72  You will found the CloudRootfs layer.
    73  
    74  ## Build your own BaseImage
    75  
    76  You can edit any files in CloudRootfs you want, for example you want to define your own docker daemon.json, just edit it and build a new CloudImage.
    77  
    78  ```shell script
    79  FROM scratch
    80  COPY . .
    81  ```
    82  
    83  ```shell script
    84  sealer build -t user-defined-kubernetes:v1.19.8 .
    85  ```
    86  
    87  Then you can use this image as a BaseImage.
    88  
    89  ## OverWrite CloudRootfs files
    90  
    91  Sometimes you don't want to care about the CloudRootfs context, but need custom some config.
    92  
    93  You can use `kubernetes:v1.19.8` as BaseImage, and use your own config file to overwrite the default file in CloudRootfs.
    94  
    95  For example: daemon.json is your docker engine config, using it to overwrite default config:
    96  
    97  ```shell script
    98  FROM kubernetes:v1.19.8
    99  COPY daemon.json etc/
   100  ```
   101  
   102  ```shell script
   103  sealer build -t user-defined-kubernetes:v1.19.8 .
   104  ```