forked from ncskier/myapp
-
Notifications
You must be signed in to change notification settings - Fork 3
/
buildah.yaml
55 lines (50 loc) · 1.61 KB
/
buildah.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This Task is from the Tekton Catalog:
# https://github.com/tektoncd/catalog/blob/master/buildah/buildah.yaml
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: buildah
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
- name: CONTEXT
description: Path to the directory to use as context.
default: .
- name: TLSVERIFY
description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry)
default: "true"
resources:
- name: source
type: git
outputs:
resources:
- name: image
type: image
steps:
- 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)', '$(inputs.params.CONTEXT)']
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: {}