forked from shipwright-io/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildstrategy_buildah_cr.yaml
44 lines (41 loc) · 1.19 KB
/
buildstrategy_buildah_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
---
apiVersion: shipwright.io/v1alpha1
kind: ClusterBuildStrategy
metadata:
name: buildah
spec:
buildSteps:
- name: build-and-push
image: quay.io/containers/buildah:v1.20.1
workingDir: $(params.shp-source-root)
securityContext:
privileged: true
command:
- /bin/bash
args:
- -c
- |
set -euo pipefail
# Building the image
echo '[INFO] Building image $(params.shp-output-image)'
buildah bud \
--tag='$(params.shp-output-image)' \
--file='$(build.dockerfile)' \
'$(params.shp-source-context)'
# Push the image
echo '[INFO] Pushing image $(params.shp-output-image)'
buildah push \
--tls-verify=false \
'$(params.shp-output-image)' \
'docker://$(params.shp-output-image)'
# Store the digest result
buildah images \
--format='{{.Digest}}' \
'$(params.shp-output-image)' | tr -d "\n" > '$(results.shp-image-digest.path)'
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 250m
memory: 65Mi