-
Notifications
You must be signed in to change notification settings - Fork 24
/
buildtemplate.yaml
50 lines (50 loc) · 2.67 KB
/
buildtemplate.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
apiVersion: build.knative.dev/v1alpha1
kind: BuildTemplate
metadata:
name: multi-stage-build-example
spec:
parameters:
- name: IMAGE
description: Where to publish the resulting image.
steps:
- name: test
image: 'docker:18.09'
args: ['build', '--target', 'test', '-t', "${IMAGE}:test", '.']
env:
- name: DOCKER_BUILDKIT
value: "1"
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
- name: check
image: 'docker:18.09'
args: ['build', '--target', 'check', '-t', "${IMAGE}:check", '.']
env:
- name: DOCKER_BUILDKIT
value: "1"
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
- name: build
image: 'docker:18.09'
args: ['build', '-t', "${IMAGE}", '.']
env:
- name: DOCKER_BUILDKIT
value: "1"
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
- name: structure-tests
image: 'gcr.io/gcp-runtimes/container-structure-test'
args: ['test', '--image', "${IMAGE}", '--config', 'structure-tests.yaml']
env:
- name: DOCKER_BUILDKIT
value: "1"
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
type: Socket