Shipwright
is an extensible framework for building container images on Kubernetes.
With Shipwright, developers get a simplified approach for building container images, by defining a minimal YAML that does not require any previous knowledge of containers or container tooling. All you need is your source code in git and access to a container registry.
Shipwright supports any tool that can build container images in Kubernetes clusters, such as:
-
We assume you already have a Kubernetes cluster (v1.20+). If you don't, you can use KinD.
-
We also require a Tekton installation (v0.27+). To install the newest supported version, run:
kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.30.0/release.yaml
-
Install the Shipwright deployment. To install the latest version, run:
kubectl apply -f https://github.com/shipwright-io/build/releases/download/v0.8.0/release.yaml
-
Install the Shipwright strategies. To install the latest version, run:
kubectl apply -f ./samples/strategy.yaml
-
Generate a secret to access your container registry, such as one on Docker Hub or Quay.io:
REGISTRY_SERVER=https://index.docker.io/v1/ REGISTRY_USER=<your_registry_user> REGISTRY_PASSWORD=<your_registry_password> kubectl create secret docker-registry push-secret \ --docker-server=$REGISTRY_SERVER \ --docker-username=$REGISTRY_USER \ --docker-password=$REGISTRY_PASSWORD \ --docker-email=<your_email>
-
Create a Build object, replacing
<REGISTRY_ORG>
with the registry username yourpush-secret
secret have access to:kubectl apply -f ./samples/build.yaml
To view the Build which you just created:
$ kubectl get builds
NAME REGISTERED REASON BUILDSTRATEGYKIND BUILDSTRATEGYNAME CREATIONTIME
buildpack-typescript-build True Succeeded ClusterBuildStrategy buildpacks-typescript-v3 68s
-
Submit your BuildRun:
kubectl apply -f ./samples/buildrun.yaml
-
Wait until your BuildRun is completed and then you can view it as follows:
$ kubectl get buildruns NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME buildpack-typescript-buildrun-xyzds True Succeeded 69s 2s
or
kubectl get buildrun --output name | xargs kubectl wait --for=condition=Succeeded --timeout=180s
-
After your BuildRun is completed, check your container registry, you will find the new generated image uploaded there.