This repository has been archived by the owner on Jun 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cnb.yaml
127 lines (119 loc) · 3.09 KB
/
cnb.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
apiVersion: build.knative.dev/v1alpha1
kind: BuildTemplate
metadata:
name: buildpacks-cnb
spec:
parameters:
- name: IMAGE
description: The image you wish to create. For example, "repo/example", or "example.com/repo/image".
- name: BUILDER_IMAGE
description: The builder image (must include v3 lifecycle and compatible buildpacks).
- name: USE_CRED_HELPERS
description: Use Docker credential helpers for Google's GCR, Amazon's ECR, or Microsoft's ACR.
default: 'false'
- name: CACHE
description: The name of the persistent app cache volume
default: empty-dir
- name: USER_ID
description: The user ID of the builder image user
default: "1000"
- name: GROUP_ID
description: The group ID of the builder image user
default: "1000"
steps:
- name: prepare
image: alpine
command: ["/bin/sh"]
args:
- "-c"
- >
chown -R "${USER_ID}:${GROUP_ID}" "/builder/home" &&
chown -R "${USER_ID}:${GROUP_ID}" /layers &&
chown -R "${USER_ID}:${GROUP_ID}" /cache &&
chown -R "${USER_ID}:${GROUP_ID}" /workspace
imagePullPolicy: Always
volumeMounts:
- name: "layers-dir"
mountPath: /layers
- name: "${CACHE}"
mountPath: /cache
- name: detect
image: ${BUILDER_IMAGE}
command: ["/lifecycle/detector"]
args:
- "-app=/workspace"
- "-group=/layers/group.toml"
- "-plan=/layers/plan.toml"
imagePullPolicy: Always
volumeMounts:
- name: "layers-dir"
mountPath: /layers
- name: restore
image: ${BUILDER_IMAGE}
command: ["/lifecycle/restorer"]
args:
- "-group=/layers/group.toml"
- "-layers=/layers"
- "-path=/cache"
imagePullPolicy: Always
volumeMounts:
- name: "${CACHE}"
mountPath: /cache
- name: "layers-dir"
mountPath: /layers
- name: analyze
image: ${BUILDER_IMAGE}
command: ["/lifecycle/analyzer"]
args:
- "-layers=/layers"
- "-helpers=${USE_CRED_HELPERS}"
- "-group=/layers/group.toml"
- "${IMAGE}"
imagePullPolicy: Always
volumeMounts:
- name: "layers-dir"
mountPath: /layers
- name: build
image: ${BUILDER_IMAGE}
command: ["/lifecycle/builder"]
args:
- "-layers=/layers"
- "-app=/workspace"
- "-group=/layers/group.toml"
- "-plan=/layers/plan.toml"
imagePullPolicy: Always
volumeMounts:
- name: "layers-dir"
mountPath: /layers
- name: export
image: ${BUILDER_IMAGE}
command: ["/lifecycle/exporter"]
args:
- "-layers=/layers"
- "-helpers=${USE_CRED_HELPERS}"
- "-app=/workspace"
- "-group=/layers/group.toml"
- "${IMAGE}"
imagePullPolicy: Always
volumeMounts:
- name: "layers-dir"
mountPath: /layers
- name: cache
image: ${BUILDER_IMAGE}
command: ["/lifecycle/cacher"]
args:
- "-group=/layers/group.toml"
- "-layers=/layers"
- "-path=/cache"
imagePullPolicy: Always
volumeMounts:
- name: "${CACHE}"
mountPath: /cache
- name: "layers-dir"
mountPath: /layers
volumes:
- name: empty-dir
emptyDir: {}
- name: layers-dir
emptyDir: {}