-
Notifications
You must be signed in to change notification settings - Fork 29
/
build-image.yml
86 lines (73 loc) · 2.25 KB
/
build-image.yml
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
description: Build a Docker image
parameters:
registry-url:
type: string
default: gcr.io
description: The GCR registry URL from ['', us, eu, asia].gcr.io
google-project-id:
type: env_var_name
default: GOOGLE_PROJECT_ID
description: The Google project ID to connect with via the gcloud CLI
image:
type: string
description: A name for your Docker image
tag:
type: string
default: latest
description: A Docker image tag
dockerfile:
type: string
default: Dockerfile
description: Name of dockerfile to use, defaults to Dockerfile
path:
type: string
default: .
description: >
Path to the directory containing your Dockerfile,
defaults to . (working directory)
extra_build_args:
type: string
default: ""
description: >
Extra flags to pass to docker build. For examples, see
https://docs.docker.com/engine/reference/commandline/build
attach-workspace:
type: boolean
default: false
description: >
Boolean for whether or not to attach to an existing workspace. Default
is false.
workspace-root:
type: string
default: "."
description: >
Workspace root path that is either an absolute path or a path relative
to the working directory. Defaults to '.' (the working directory)
docker-context:
type: string
default: .
description: >
Path to the directory containing your build context, defaults to .
(working directory)
no_output_timeout:
type: string
default: "10m"
description: >
Pass through a default timeout if your Docker build does not output
anything for more than 10 minutes.
steps:
- when:
condition: <<parameters.attach-workspace>>
steps:
- attach_workspace:
at: <<parameters.workspace-root>>
- docker/build:
step-name: Build Docker image for GCR
dockerfile: <<parameters.dockerfile>>
docker-context: <<parameters.docker-context>>
path: <<parameters.path>>
registry: "<<parameters.registry-url>>/$<<parameters.google-project-id>>"
image: <<parameters.image>>
tag: <<parameters.tag>>
extra_build_args: <<parameters.extra_build_args>>
no_output_timeout: <<parameters.no_output_timeout>>