Skip to main content
A Kubernetes cluster cannot run a locally-built binary — it needs an image reference that the cluster can pull from a registry. In this lesson you’ll:
  • set a concrete image tag that points to a registry,
  • build a controller image via the project’s Makefile,
  • push that image to a registry, and
  • confirm the registry contains a manifest for the tag.

1) Set the image reference

Set the IMG environment variable to a registry path and a version tag. In this recording we use a local registry at 127.0.0.1:5000 and tag v0.1.0:

2) Build the image

Use the Makefile target that forwards IMG into Docker. The Makefile injects the tag into the Docker build so the resulting image is named as above.
The project uses a multi-stage Dockerfile. The build usually compiles a manager binary in the builder stage, then copies that into a minimal runtime image in a later stage. Example (truncated) build output:
Summary:
  • Builder stage compiles the manager binary.
  • Runtime stage packages that binary into the final controller image.

3) Push the image to the registry

Push the tag you just built so the registry stores the layers and writes an image manifest:
Push output will show each layer uploaded and a final digest for the pushed tag. Example:
The registry manifest written for v0.1.0 is what Kubernetes later uses when resolving the image reference during deployment.

4) Verify the registry tag and manifest

To confirm the tag and its digest are visible in the registry (i.e., not just in your local Docker cache), inspect the image with Docker Buildx imagetools:
Example output shows the tag’s digest and the platform manifests it references:
Tags (like v0.1.0) are mutable references, while the digest (sha256:...) is the immutable content identifier. Using the digest (for example image: 127.0.0.1:5000/course/webapp-operator@sha256:<digest>) in manifests or deployment specs guarantees the exact image bytes that will be pulled.
If you’re using a local registry (e.g., 127.0.0.1:5000) make sure the registry service is running and your Docker daemon is configured to allow pushing to that host (insecure registry settings may be required). Pushing to remote registries may also require authentication.

Quick reference — common commands

Deploying with the pushed image

Now that the controller image is available from the registry, pass the same IMG value into your deployment step (for example):
Or pin by digest in Kubernetes manifests:
Using the digest above ensures the cluster pulls the exact content you pushed.

Watch Video