Skip to content

Commit ce85065

Browse files
committed
Remove multi-arch from the default build example to speed it up
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent d09cfbc commit ce85065

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/openfaas-pro/builder.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ mv hello-world context
144144
# function.
145145
export REGISTRY=ttl.sh
146146
export OWNER=alexellis2
147-
echo -n '{"image": "'$REGISTRY'/'$OWNER'/test-image-hello:0.1.0", "platforms": ["linux/amd64","linux/arm64"]}' > com.openfaas.docker.config
147+
echo -n '{"image": "'$REGISTRY'/'$OWNER'/test-image-hello:0.1.0", "platforms": ["linux/amd64"]}' > com.openfaas.docker.config
148148
```
149149

150+
Note: The `platforms` key is optional and is only used to specify the platform of the image to build. If not specified, the builder will build an image for the host platform, for multi-arch builds you could set the value to i.e. `["linux/amd64","linux/arm64"]`.
151+
150152
If you wish, you can also construct this filesystem using your own application, but it is easier to execute the `faas-cli` command from your own code.
151153

152154
Then create a tar archive of the context of the `/tmp/functions/build/` directory:
@@ -292,6 +294,8 @@ You may need to enable build arguments for the Dockerfile, these can be passed t
292294

293295
You may wish to cross-compile a function to run on an arm64 host, if so, you can provide a `platform` key in the configuration file.
294296

297+
When no `platforms` key is specified, the builder will build an image for the host platform.
298+
295299
You will need to make sure your Dockerfile uses the proper syntax, the official templates are a good reference if you need guidance, otherwise reach out to our team if you get stuck.
296300

297301
The below will build an image for arm64 only and must be deployed only to an arm64 host using OpenFaaS Profiles to ensure it is scheduled correctly to an arm64 host.
@@ -317,6 +321,18 @@ Bear in mind:
317321
* multi-arch images will usually take longer to publish than single-arch images due to emulation with QEMU
318322
* any steps performed under a TARGETARCH which differs from BUILDARCH will be emulated with QEMU which will add overhead to the build process - you can mitigate this by running a dedicated arm64 and amd64 pro-builder Helm chart installation
319323

324+
## Skip pushing the image to the registry
325+
326+
You can skip pushing the image to the registry by setting the `skipPush` key to `true` in the configuration file.
327+
328+
```json
329+
{
330+
"skipPush": true
331+
}
332+
```
333+
334+
In this mode, the builder can be configured through additional parameters to build directly into the containerd library for instant deployment to OpenFaaS Edge. Contact us for more information if this use-case is of interest to you.
335+
320336
## How to scale the builder
321337

322338
The Function Builder can be scaled out, which also deploys additional replicas of the Function Builder:

0 commit comments

Comments
 (0)