Skip to content

Commit 49911de

Browse files
committed
chore: optimize docs about LAUNCH instruction
Signed-off-by: yuxing.lyx <[email protected]>
1 parent e89b9d3 commit 49911de

File tree

5 files changed

+80
-10
lines changed

5 files changed

+80
-10
lines changed

attachment/images/image-arch.png

67.8 KB
Loading

src/docs/concept/kubefile.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ For example , copy directory `apollo` to `rootfs/charts/apollo`
3737

3838
## CMDS instruction
3939

40-
The format of CMDS instruction will execute any commands in a new layer. The CMDS command will be executed when `sealer run` . it is generally used to start applications or configure
41-
the cluster. and it is the same with `Dockerfile` CMD , if there are multiple `CMDS` instructions in the `Kubefile`, only the last one takes effect.
42-
And it conflicts with `LAUNCH`, and only one of the two can exist.
40+
> NOTE: `LAUNCH` instruction is more recommended than `CMDS`.
41+
42+
The format of CMDS instruction will execute any commands in a new layer. The CMDS command will be executed when `sealer run` .
43+
It is generally used to start applications or configure the cluster.
44+
45+
And there are some points that require special attention:
46+
47+
+ Just like with `Dockerfile` CMD , if there are multiple `CMDS` instructions in the `Kubefile`, only the last one takes effect.
48+
+ The `CMDS` of the parent image will not be inherited, and you need to redefine it in the child image if you need to have it set.
49+
+ The `CMDS` instruction and the `LAUNCH` instruction are in conflict, and only one of them can exist.
4350

4451
> command format:CMD {command args ...}
4552
@@ -80,7 +87,12 @@ For example:
8087
## LAUNCH instruction
8188

8289
The `LAUNCH` instruction specifies a list of apps to launch when sealer run. Only one `LAUNCH` instruction can be defined in the Kubefile.
83-
And it conflicts with `CMDS`, and only one of the two can exist.
90+
91+
And there are some points that require special attention:
92+
93+
+ The `LAUNCH` of the parent image will not be inherited, and you need to redefine it in the child image if you need to have it set.
94+
+ The `LAUNCH` instruction and the `CMDS` instruction are in conflict, and only one of them can exist.
95+
8496
> command format:LAUNCH {command args ...}
8597
8698
USAGE:

src/docs/concept/sealer-image.md

+56-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ APP mysql https://charts/mysql.tgz
2222
APP elasticsearch https://charts/ elasticsearch.tgz
2323
APP redis local://redis.yaml
2424
APP businessApp local://install.sh
25-
LAUNCH [" mysql "," redis "," businessApp]
25+
LAUNCH ["mysql", "redis", "businessApp"]
2626
```
2727

2828
build command:
@@ -39,17 +39,69 @@ An `Sealer Image` that contains Kubernetes or other KxS runtimes.
3939

4040
![](../../../attachment/images/cluster-kubefile.png)
4141

42-
### How to build an cluster image
42+
### How to build a custom cluster image
43+
44+
```shell
45+
# sealer inspect docker.io/sealerio/kubernetes:v1.22.15
46+
{
47+
"id": "bb75382891e7f04f192f1baeab18ef9c9f5503f4de8ac6dfc2a4d94f2164dde6",
48+
"name": "docker.io/sealerio/kubernetes:v1.22.15",
49+
"digest": "sha256:2f92b0149053ece9de6c683754f76fb9fd023a44540a9e33fc371afb8b76cc1b",
50+
"manifestv1": {
51+
......
52+
},
53+
"ociv1": {
54+
......
55+
},
56+
"buildClient": {
57+
"sealerVersion": "v0.9.0",
58+
"buildahVersion": "1.27.1"
59+
},
60+
"schemaVersion": "v1alpha1",
61+
"type": "kube-installer",
62+
"applications": [
63+
{
64+
"name": "calico",
65+
"type": "shell",
66+
"launchfiles": [
67+
"calico.sh"
68+
],
69+
"version": "v1"
70+
}
71+
],
72+
"launch": {
73+
"app_names": [
74+
"calico"
75+
]
76+
}
77+
}
78+
```
4379

4480
Kubefile:
4581

82+
> NOTE: When we build an image based on a base image,
83+
> we need to re-declare the app that needs to be launched in the base image for `LAUNCH` instruction.
84+
>
85+
> For more details about `APP` and `LAUNCH`, please refer to [Kubefile](kubefile.md)
86+
4687
```
4788
FROM docker.io/sealerio/kubernetes:v1.22.15
4889
APP mysql https://charts/mysql.tgz
49-
APP elasticsearch https://charts/ elasticsearch.tgz
90+
APP elasticsearch https://charts/elasticsearch.tgz
5091
APP redis local://redis.yaml
5192
APP businessApp local://install.sh
52-
LAUNCH [" mysql "," elasticsearch"," redis "," businessApp]
93+
LAUNCH ["calico", "mysql", "elasticsearch", "redis", "businessApp"]
94+
```
95+
96+
or
97+
98+
```
99+
FROM docker.io/sealerio/kubernetes:v1.22.15
100+
COPY mysql.tgz .
101+
COPY elasticsearch.tgz .
102+
COPY redis.yaml .
103+
COPY install.sh .
104+
CMDS ["sh application/apps/calico/calico.sh", "helm install mysql.tgz", "helm install elasticsearch.tgz", "kubectl apply -f redis.yaml", "bash install.sh"]
53105
```
54106

55107
build command:

src/docs/getting-started/quick-start.md

+6
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ Some information of the basic settings will be written to the cluster and stored
9292
```shell
9393
sealer delete -a
9494
```
95+
96+
## SEE ALSO
97+
98+
+ [Kubefile](../concept/kubefile.md)
99+
+ [Sealer Image](../concept/sealer-image.md)
100+
+ [Sealer Cluster Image List](../sealer-images/cluster-images.md)

src/docs/introduction/architecture.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Cluster module implements the desired state of cluster through Clusterfile a
88

99
## Image module
1010

11-
![](https://user-images.githubusercontent.com/83740799/210050287-487d3255-96e8-4030-bbff-a0134b1d18bb.png)
11+
![](../../../attachment/images/image-arch.png)
1212

1313
### Build Engine
1414

@@ -28,4 +28,4 @@ disk and the remote registry hub.
2828
* common user interface: provides a common user interface to launch Sealer Image through sealer CLI or Clusterfile.
2929
* image preprocessor: implement content distribution and modification through config or env render for the Sealer Image.
3030
* cluster runtime: cluster installer implementation, like using kubeadm to install or upgrade k8s cluster.
31-
* plugin : implements the maintenance of hosts and the modification of the cluster at different process phase.
31+
* plugin : implements the maintenance of hosts and the modification of the cluster at different process phase.

0 commit comments

Comments
 (0)