forked from shipwright-io/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildstrategy_source-to-image_cr.yaml
77 lines (75 loc) · 2.22 KB
/
buildstrategy_source-to-image_cr.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
apiVersion: shipwright.io/v1alpha1
kind: ClusterBuildStrategy
metadata:
name: source-to-image
spec:
buildSteps:
- command:
- /usr/local/bin/s2i
- build
- $(params.shp-source-context)
- $(build.builder.image)
- '--as-dockerfile'
- /gen-source/Dockerfile.gen
image: quay.io/openshift-pipeline/s2i:nightly
imagePullPolicy: Always
name: s2i-build-as-dockerfile
volumeMounts:
- mountPath: /gen-source
name: gen-source
workingDir: $(params.shp-source-root)
- args:
- '--skip-tls-verify=true'
- '--dockerfile=/gen-source/Dockerfile.gen'
- '--context=/gen-source'
- '--destination=$(params.shp-output-image)'
- '--oci-layout-path=/kaniko/oci-image-layout'
- '--snapshotMode=redo'
- '--push-retry=3'
command:
- /kaniko/executor
env:
- name: DOCKER_CONFIG
value: /tekton/home/.docker
image: gcr.io/kaniko-project/executor:v1.6.0
name: build-and-push
securityContext:
runAsUser: 0
allowPrivilegeEscalation: false
capabilities:
add:
- CHOWN
- DAC_OVERRIDE
- FOWNER
- SETGID
- SETUID
- SETFCAP
- KILL
volumeMounts:
- mountPath: /gen-source
name: gen-source
- name: layout
mountPath: /kaniko/oci-image-layout
workingDir: /gen-source
- name: results
image: registry.access.redhat.com/ubi8/ubi-minimal
command:
- /bin/bash
args:
- -c
- |
set -euo pipefail
# Store the image digest
grep digest /kaniko/oci-image-layout/index.json | sed -E 's/.*sha256([^"]*).*/sha256\1/' | tr -d '\n' > "$(results.shp-image-digest.path)"
# Store the image size
du -b -c /kaniko/oci-image-layout/blobs/sha256/* | tail -1 | sed 's/\s*total//' | tr -d '\n' > "$(results.shp-image-size.path)"
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: layout
mountPath: /kaniko/oci-image-layout