Skip to main content

Building an Example CloudImage

This is an example for building an nginx-ingress CloudImage using helm.

Download helm chart

$ mkdir ingress-nginx && cd ingress-nginx
$ helm repo add ingress-nginx
$ helm pull ingress-nginx/ingress-nginx

Then you will got the chart:

$ ls

Add image list

sealos will automatically download images parsed from those locations, and cache them into registry dir:

  • images/shim/$images_file
  • manifests/*.yaml
  • manifests rendered from chart in charts/ directory, chart directory and chart tar file are both supported

for example:

$ cat images/shim/nginxImages
$ tree
|-- Dockerfile
|-- charts
| |-- ingress-nginx-4.1.0.tgz
| `-- ingress-nginx.values.yaml

if custom values file named with form $chartName.values.yaml exists, manifests will rendered with custom values, just like helm template -f $chartName.values.yaml ....

Add a Dockerfile

FROM scratch
COPY . .
CMD ["helm install ingress-nginx charts/ingress-nginx-4.1.0.tgz --namespace ingress-nginx --create-namespace -f charts/ingress-nginx.values.yaml"]


$ sealos build -f Dockerfile -t .

Push to registry

$ sealos login
$ sealos push