Skip to main content

Building an Ingress Cluster Image

Here we demonstrate how to build an nginx-ingress cluster image using Helm.

Download the Helm Chart

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

You will find the downloaded chart:

$ ls

Add Image List

Sealos will download the images in the image list and cache them in the registry directory.

The directory must be in the format images/shim/[your image list filename]:

$ cat images/shim/nginxImages

Write the Dockerfile

FROM scratch
COPY ../examples .
CMD ["helm install ingress-nginx ingress-nginx-4.1.0.tgz --namespace ingress-nginx --create-namespace"]

Build the Cluster Image

$ sealos build -f Dockerfile -t .

Sealos will automatically add the image dependencies from the image list to the cluster image, magically saving the Docker images it depends on inside. When running in another environment, it will magically check if the Docker images exist in the cluster. If they do, it will automatically download them; otherwise, it will download them from Users do not need to modify the Docker image addresses in the Helm chart. This utilizes the black technology of image caching proxy.

Push to the Image Registry

$ sealos login
$ sealos push

Run the Cluster Image

$ sealos run