Overview

You can run migetpacks as a Kubernetes Job for one-off or scheduled builds without needing the full Shipwright framework. This approach gives you direct control over the build process while still leveraging Kubernetes for orchestration.

Kubernetes Job

A basic Job that builds and pushes a container image:
The privileged: true security context is required because migetpacks uses Docker-in-Docker (DinD) internally to build images.

Build Cache with PVC

Use a ReadWriteMany (RWX) PersistentVolumeClaim to share package manager caches across builds. This significantly speeds up dependency installation for repeated builds.
Mount it in your Job:
The cache stores package manager artifacts per language:

ConfigMap for Environment Variables

Use a ConfigMap to manage build configuration separately from the Job definition:
Reference it in your Job:

Secret for Registry Credentials

Store registry credentials in a Kubernetes Secret:
Mount it as a Docker config file:

RESULT_FILE with Shared Volume

Use an emptyDir volume to share build results between the builder and a post-build notification container:
Set the RESULT_FILE environment variable to write results to this volume:
The builder always exits with code 0, writing the build status to the result file. Post-build containers should check the status field to determine success or failure.

Post-Build Notification

Use an init container pattern or a sidecar to process build results. Here is an example using a second container that waits for the result file:

Full Example

A complete Job definition with all components — source, cache, registry credentials, configuration, and post-build notification: