diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d29eaf0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:stable-slim + +RUN apt-get update && apt-get install -y \ + procps build-essential dpkg-dev dpkg-cross \ + devscripts make && \ + apt-get clean -y && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/cache/apt/* + diff --git a/tekton-debian-kernel-build-image.yaml b/tekton-debian-kernel-build-image.yaml new file mode 100644 index 0000000..3d0852d --- /dev/null +++ b/tekton-debian-kernel-build-image.yaml @@ -0,0 +1,91 @@ +apiVersion: tekton.dev/v1alpha1 +kind: PipelineResource +metadata: + name: debian-kernel-build-git +spec: + type: git + params: + - name: revision + value: master + - name: url + value: http://git-ui.lan/chaos/kernel-configs.git +--- +apiVersion: tekton.dev/v1alpha1 +kind: PipelineResource +metadata: + name: debian-kernel-build-image +spec: + type: image + params: + - name: url + value: docker-registry.lan/debian-kernel-build-stable + - name: +--- +apiVersion: tekton.dev/v1beta1 +kind: Task +metadata: + name: build-debian-kernel-build-from-source +spec: + params: + - name: pathToContainerFile + type: string + description: The path to the dockerfile to build + default: $(resources.inputs.container-source.path)/Dockerfile + - name: pathToContext + type: string + description: | + The build context used by Kaniko + (https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts) + default: $(resources.inputs.container-source.path) + resources: + inputs: + - name: container-source + type: git + outputs: + - name: builtImage + type: image + steps: + - name: debug-print + image: busybox + command: + - echo + args: + - ockerfile: $(params.pathToContainerFile) + - contextPath: $(params.pathToContext) + - name: build-and-push + image: gcr.io/kaniko-project/executor:arm64 + # specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential + env: + - name: "DOCKER_CONFIG" + value: "/tekton/home/.docker/" + command: + - /kaniko/executor + args: + - --dockerfile=$(params.pathToContainerFile) + - --destination=$(resources.outputs.builtImage.url) + - --context=$(params.pathToContext) + - --skip-tls-verify +--- +apiVersion: tekton.dev/v1beta1 +kind: TaskRun +metadata: + name: build-container-image-from-git-source-task-run +spec: + #serviceAccountName: dockerhub-service + taskRef: + name: build-debian-kernel-build-from-source + params: + - name: pathToContainerFile + value: Dockerfile + resources: + inputs: + - name: container-source + resourceRef: + name: debian-kernel-build-git + outputs: + - name: builtImage + resourceRef: + name: debian-kernel-build-image + + + \ No newline at end of file