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
Copy file name to clipboardExpand all lines: content/en/docs/concepts/function_build.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,37 @@ spec:
40
40
> To push the function image to a container registry, you have to create a secret containing the registry's credential and add the secret to `imageCredentials`.
41
41
> You can refer to the [prerequisites](../../getting-started/Quickstarts/prerequisites) for more info.
42
42
43
+
### Build functions from local source code
44
+
45
+
To build functions from local source code, we need a bundle image which contains the source code.
46
+
We can use the following `Dockerfile` to build a bundle image.
47
+
48
+
```shell
49
+
FROM scratch
50
+
51
+
WORKDIR /
52
+
COPY samples samples/
53
+
```
54
+
55
+
> We suggest using a empty image such as `scratch` as the base image of the bundle image, a non-empty base image may cause the source code copy to fail.
56
+
57
+
The `srcRepo` of function should be changed like this.
> The `sourceSubPath` is the absolute path of the source code in the bundle image.
73
+
43
74
## Build functions with the pack CLI
44
75
45
76
Usually it's necessary to build function images directly from local source code especially for debug purpose or for offline environment. You can use the pack CLI for this.
0 commit comments