Skip to content

Shipwright - a framework for building container images on Kubernetes

License

Notifications You must be signed in to change notification settings

sayan-biswas/shipwright-build

Repository files navigation

Build v2

*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.

How

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 Builds.

Strategies

Create resources and configuration in order to implement the following strategies.

Buildpacks v3

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

Source-to-Image (s2i)

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"

Buildah

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'

Kaniko

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

Try it!

  • Install Tekton ( You could use the OpenShift Pipelines Community Operator ).
  • Execute ./hack/crd.sh install
  • Start a sample Kaniko build

Development


Roadmap

Status of support for build strategies

Build Strategy Alpha Beta GA Support
Source-to-Image ☑️
Buildpacks-v3 ⚪️
Kaniko ☑️
Buildah ☑️

Status of support for generic features


Feature Alpha Beta GA Support
Private Git Repos ☑️
Runtime Base Image ⚪️
Binary builds
Image Caching
ImageStreams support
Entitlements

Key

⚪️ Initial work is in progress

☑️ Validated to be working

✅ Can be shipped

About

Shipwright - a framework for building container images on Kubernetes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.0%
  • Shell 2.3%
  • Other 0.7%