You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**What**
- Update the yaml reference with documentation for build_options,
readonly_root_filesystem, skip_build
Resolves#80
Signed-off-by: Lucas Roesler <[email protected]>
Copy file name to clipboardExpand all lines: docs/reference/yaml.md
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,25 @@ The function `handler` field refers to a folder where the function's source code
57
57
58
58
The `image` field refers to a Docker image reference, this could be on the Docker Hub, in your local Docker library or on another remote server.
59
59
60
+
#### Function: Skip build
61
+
62
+
The `skip_build` field controls if the CLI will attempt to build the Docker image for the function. When `true`, the build step is skipped and you should see a message printed to the terminal `Skipping build of: "function name"`.
63
+
64
+
This value is set as a boolean.
65
+
66
+
#### Function: Build Options
67
+
68
+
The `build_options` allows you to pass a list of [Docker build arguments](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg) to the build process. When the language template supports it, this allows you to customize the build without modifying the underlying template.
69
+
70
+
For example, the [official python3 language template](https://github.com/openfaas/templates/blob/master/template/python3/Dockerfile) allows passing additional Alpine `apk` packages to be installed during build process. To isntall the [`ca-certificates`](https://pkgs.alpinelinux.org/package/edge/main/x86_64/ca-certificates) package for your `python3` function, you can specify
71
+
72
+
```yaml
73
+
build_options:
74
+
- ca-certificates
75
+
```
76
+
77
+
Important note: that the configuration of this value is dependent on the language template.
78
+
60
79
#### Function: Environmental variables
61
80
62
81
You can set configuration via environmental variables either in-line within the YAML file or in a separate external file. Do not store confidential or private data in environmental variables. See: secrets.
@@ -108,6 +127,14 @@ secrets:
108
127
- s3_secret_key
109
128
```
110
129
130
+
#### Function: Read-Only Root Filesystem
131
+
132
+
The `readonly_root_filesystem` indicates that the function file system will be set to read-only except for a scratch/temporary folder `/tmp`. This prevents the function from writing to or modifying the filesystem (e.g. system files). This is used to provide stricter security for your functions. You can set this value as a boolean:
133
+
134
+
```yaml
135
+
readonly_root_filesystem: true
136
+
```
137
+
111
138
#### Function: Constraints
112
139
113
140
Constraints are passed directly to the underlying container orchestrator. They allow you to pin a function to certain host or type of host.
@@ -128,7 +155,7 @@ Or only using nodes running with Windows:
128
155
129
156
#### Function: Labels
130
157
131
-
Labels can be applied through a map which is passed directly to the container scheduler.
158
+
Labels can be applied through a map which is passed directly to the container scheduler.
132
159
Labels are also available from the OpenFaaS REST API for querying or grouping functions.
133
160
134
161
Example of using a label to group by user or apply a `canary` label:
@@ -139,10 +166,10 @@ Example of using a label to group by user or apply a `canary` label:
139
166
Git-Owner: alexellis
140
167
```
141
168
142
-
> Important note: When used with a Kubernetes provider, labels support a restricted character set and length.
143
-
*"Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character
169
+
> Important note: When used with a Kubernetes provider, labels support a restricted character set and length.
170
+
*"Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character
144
171
([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between."*
145
-
>
172
+
>
146
173
>See [Syntax and character set](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set)
0 commit comments