Skip to content

List images for air-gapped preloading

This content is for the v0.1 version. Switch to the latest version for up-to-date documentation.

Use kix images to produce a deduplicated list of the container images in a cluster definition. The command evaluates the cluster locally and does not connect to Kubernetes.

Run the command with the cluster name:

Run in kix-examples/
❱ kix images how-to-application
docker.io/curlimages/curl:8.14.1@sha256:9a1ed35addb45476afa911696297f8e115993df459278ed036182dd2cd22b67b
docker.io/library/nginx:1.27-alpine

The default output contains one complete image reference per line. Kix reads images from Pods and pod templates, including regular, init, and ephemeral containers. It also includes images that packages declare for resources an operator creates later.

Add --sources to show each workload and container that refers to an image:

Run in kix-examples/
❱ kix images how-to-application --sources
docker.io/curlimages/curl:8.14.1@sha256:9a1ed35addb45476afa911696297f8e115993df459278ed036182dd2cd22b67b
  Job how-to-app/production-health (container: probe)
docker.io/library/nginx:1.27-alpine
  Deployment how-to-app/preview (container: nginx)
  Deployment how-to-app/production (container: nginx)

Use this view when an unexpected image appears or when you need to identify the package that should pin it to a digest.

For scripts, request JSON instead:

Run in kix-examples/
❱ kix images how-to-application --output json Show output
[
  {
    "image": "docker.io/curlimages/curl:8.14.1@sha256:9a1ed35addb45476afa911696297f8e115993df459278ed036182dd2cd22b67b",
    "sources": [
      {
        "container": "probe",
        "kind": "Job",
        "name": "production-health",
        "namespace": "how-to-app"
      }
    ]
  },
  {
    "image": "docker.io/library/nginx:1.27-alpine",
    "sources": [
      {
        "container": "nginx",
        "kind": "Deployment",
        "name": "preview",
        "namespace": "how-to-app"
      },
      {
        "container": "nginx",
        "kind": "Deployment",
        "name": "production",
        "namespace": "how-to-app"
      }
    ]
  }
]

Each JSON entry contains the image reference and its source resources.

Because the default output is one image per line, you can pass it to an image tool. For example, pull every image into the local Docker image store:

Run in kix-examples/
❱ kix images how-to-application | xargs -n1 docker pull

To load those images into a local kind cluster:

Run in kix-examples/
❱ kix images how-to-application | xargs -n1 kind load docker-image --name kix-demo

For a remote or air-gapped cluster, copy or mirror the listed references using the tool your registry workflow already uses. Run kix images again whenever the cluster definition or its image pins change.