*Proposal / *Work-in-progress
An API to build images on Kubernetes using popular strategies and tools like source-to-image, buildpack-v3, kaniko and buildah, in an extensible way.
The following are the BuildStrategies
supported by this operator, out-of-the-box:
Users have the option to define their own BuildStrategies
and make them available for consumption
by Build
s.
Create resources and configuration in order to implement the following strategies.
Create the below CR for starting a buildpacks-v3 Build
---
apiVersion: build.dev/v1alpha1
kind: Build
metadata:
name: example-build-buildpack
spec:
# Git Source definition
source:
url: https://github.com/sclorg/nodejs-ex
credentials:
name: github-auth-olemefer
# Strategy defined in the buildpacks-v3 CR
# in the 'openshift' namespace.
strategy:
name: "buildpacks-v3"
namespace: "openshift"
# Build to be run in this image.
builderImage: "heroku/buildpacks:18"
# Generated image.
output:
image: "quay.io/olemefer/nodejs-ex:v1"
credentials:
name: quayio-olemefer
Create the below CR for starting an s2i Build
---
apiVersion: build.dev/v1alpha1
kind: Build
metadata:
name: s2i-nodejs-build
spec:
source:
url: https://github.com/sclorg/nodejs-ex
strategy:
name: "source-to-image"
namespace: "openshift"
builderImage: "docker.io/centos/nodejs-10-centos7"
output:
image: "image-registry.openshift-image-registry.svc:5000/sbose/nodejs-ex"
Create the below CR for starting a Buildah Build
---
apiVersion: build.dev/v1alpha1
kind: Build
metadata:
name: buildah-golang-build
spec:
dockerfile: Dockerfile
strategy:
name: "buildah"
namespace: "openshift"
output:
image: 'image-registry.openshift-image-registry.svc:5000/sbose/taxi-app'
source:
url: 'https://github.com/sbose78/taxi'
Create the below CR for starting a Kaniko Build
---
apiVersion: build.dev/v1alpha1
kind: Build
metadata:
name: kaniko-golang-build
spec:
source:
url: https://github.com/sbose78/taxi
strategy:
name: "kaniko"
namespace: "openshift"
dockerfile: "Dockerfile"
pathContext: "./"
output:
image: "image-registry.openshift-image-registry.svc:5000/sbose/taxi-app"
On Reconcile, the Build
CR's Status
gets updated,
---
apiVersion: build.dev/v1alpha1
kind: Build
metadata:
name: kaniko-golang-build
spec:
source:
url: https://github.com/sbose78/taxi
strategy:
name: "kaniko"
namespace: "openshift"
dockerfile: "Dockerfile"
pathContext: "./"
output:
image: "image-registry.openshift-image-registry.svc:5000/sbose/taxi-app"
status:
status: Running
- Install Tekton ( You could use the OpenShift Pipelines Community Operator ).
- Execute
./hack/crd.sh install
- Start a sample Kaniko build
- Build, test & run using HACK.md.
Build Strategy | Alpha | Beta | GA Support |
---|---|---|---|
Source-to-Image | ☑️ | ||
Buildpacks-v3 | ⚪️ | ||
Kaniko | ☑️ | ||
Buildah | ☑️ |
Feature | Alpha | Beta | GA Support |
---|---|---|---|
Private Git Repos | ☑️ | ||
Runtime Base Image | ⚪️ | ||
Binary builds | |||
Image Caching | |||
ImageStreams support | |||
Entitlements |
⚪️ Initial work is in progress
☑️ Validated to be working
✅ Can be shipped