Taking the opposite direction of OCF-196 (using openshift
build/buildconfig), we want to be able to run a s2i build (using s2i
binary and buildah
) to build an image that can be later on used for
a knative service.
This means:
- Create a
builder
image that can generate aDockerfile
froms2i
- Create a
builder
image that usebuildah
to build thatDockerfile
(could be the same builder image) - Provide a build-template (most likely upstream in https://github.com/knative/build-templates`) for that
This folder contains 2 builders:
buildah-builder
, that contains everything required for building dockerfiles without Docker, usingbuildah
. It is auto-built on the hub :vdemeester/buildah-builder
s2i-builder
, that contains usess2i
a.k.a. source-to-image to generate aDockerfile
from a source file and a base image. It can be combined withbuildah-builder
. It is auto-built on the hub :vdemeester/s2i-builder
There is 2 templates too (that are or will be upstream in
knative/build-templates
)
:
-
buildah.template.yml
, that uses thebuildah-builder
to build an image inknative
.Example:
apiVersion: build.knative.dev/v1alpha1 kind: Build metadata: name: buildah-build-my-repo spec: timeout: 50m serviceAccountName: build-bot source: git: url: https://github.com/vdemeester/os-sample-python.git revision: dockerfile template: name: buildah arguments: - name: IMAGE value: vdemeester/my-app
-
s2i.template.yml
, that usess2i-builder
andbuildah-builder
to build an image, usings2i
, inknative
.Example:
apiVersion: build.knative.dev/v1alpha1 kind: Build metadata: name: s2i-build-my-repo spec: timeout: 50m serviceAccountName: build-bot source: git: url: https://github.com/vdemeester/os-sample-python revision: master template: name: s2i arguments: - name: BASE_IMAGE value: centos/python-36-centos7 - name: IMAGE value: docker.io/vdemeester/helloworld-python