Created
April 15, 2020 17:35
-
-
Save sub-mod/1346cdb3e3b3382938afb5176f6aa32f to your computer and use it in GitHub Desktop.
working taskrun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: Task | |
metadata: | |
name: ic-buildah1 | |
spec: | |
inputs: | |
params: | |
- name: BUILDER_IMAGE | |
description: The location of the buildah builder image. | |
default: quay.io/buildah/stable:v1.11.0 | |
- name: DOCKERFILE | |
description: Path to the Dockerfile to build. | |
default: ./Dockerfile.ubi7 | |
- name: TLSVERIFY | |
description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) | |
default: "false" | |
resources: | |
- name: source | |
type: git | |
outputs: | |
resources: | |
- name: build-image | |
type: image | |
steps: | |
- name: ls | |
image: busybox | |
workingDir: /workspace/source | |
command: ["ls"] | |
volumeMounts: | |
- name: varlibcontainers | |
mountPath: /var/lib/containers | |
securityContext: | |
privileged: true | |
- name: build | |
image: $(inputs.params.BUILDER_IMAGE) | |
workingDir: /workspace/source | |
command: ["buildah", "bud", '--tls-verify=$(inputs.params.TLSVERIFY)', '--layers', '-f', '$(inputs.params.DOCKERFILE)', '-t', '$(outputs.resources.image.url)', '.'] | |
volumeMounts: | |
- name: varlibcontainers | |
mountPath: /var/lib/containers | |
securityContext: | |
privileged: true | |
- name: push | |
image: $(inputs.params.BUILDER_IMAGE) | |
workingDir: /workspace/source | |
command: ['buildah', 'push', '--tls-verify=$(inputs.params.TLSVERIFY)', '$(outputs.resources.image.url)', 'docker://$(outputs.resources.image.url)'] | |
volumeMounts: | |
- name: varlibcontainers | |
mountPath: /var/lib/containers | |
securityContext: | |
privileged: true | |
volumes: | |
- name: varlibcontainers | |
emptyDir: {} | |
--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: PipelineResource | |
metadata: | |
name: ic-repo1 | |
spec: | |
type: git | |
params: | |
- name: url | |
value: https://github.com/sub-mod/manylinux-images.git | |
--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: PipelineResource | |
metadata: | |
name: ic-build-image1 | |
spec: | |
type: image | |
params: | |
- name: url | |
value: docker-registry.default.svc:5000/mlperf/build-image:latest | |
--- | |
apiVersion: tekton.dev/v1alpha1 | |
kind: TaskRun | |
metadata: | |
name: ic-buildah-run1 | |
namespace: mlperf | |
spec: | |
taskRef: | |
name: ic-buildah1 | |
serviceAccount: mlperf | |
inputs: | |
resources: | |
- name: source | |
resourceRef: | |
name: ic-repo1 | |
outputs: | |
resources: | |
- name: build-image | |
resourceRef: | |
name: ic-build-image1 | |
--- | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment