Deploying Pre-Built Functions
If you followed the function-deployment guide, you built and deployed a function in a single convenient step using the
nuctl CLI. However, it is sometimes desirable to build a function once and deploy it many times with different configuration. This guide will walk you through that process using
In this scenario, you'll use the Go hello-world example example.
Building a function
nuctl, you can issue a build - specifying the URL of the Go hello-world:
nuctl build hello-world --path https://raw.githubusercontent.com/nuclio/nuclio/master/hack/examples/golang/helloworld/helloworld.go \ --registry $(minikube ip):5000
This produces the
nuclio/processor-hello-world:latest image and pushes it to
192.168.64.8:5000. The image contains everything the function needs to run, except a configuration file.
Deploying the pre-built function
To deploy the function to your platform, you'll use the
nuctl deploy command with the
--run-image option. When
--run-image is present,
nuctl does not initiate a build process - only creates a function in the platform and waits for it to become ready.
nuctl deploy hello-world --run-image localhost:5000/nuclio/processor-hello-world:latest \ --runtime golang \ --handler main:Handler \ --namespace nuclio
You can deploy this function several times, providing different labels, triggers, etc. - yet still use the same image.