- Documentation
Volcano Engine Function as a Service
Development Guide
Code development
Native runtime
Image-based deployment
Native runtime
Image-based deployment
Image-based deployment
Native functions support two deployment methods: using code packages and using images. For image-based deployments, you need to write a Dockerfile to assemble your code package into an image and upload the image to CR in the same Volcano Engine region as the function. This topic describes how to build an image.
Background information
Image-based deployment includes the following steps:
- Build an image: You need to write a Dockerfile to assemble your code package into an image, and upload the image to CR in the same Volcano Engine region where you want to deploy the function.
- Create the function: veFaaS assumes the service role for the function to pull the image from Volcano Engine Container Registry. After the image is pulled, it is synchronized to veFaaS.
- Release the function: After the specified image version is released, the current service takes over all requests.
Prerequisites
Volcano Engine CR has been activated. A CR instance has been created with a password set. A namespace and OCI artifact repository have been created. For detailed steps, see Getting Started with CR. Limits
- Requirements for HTTP services
- Your service must provide a startup script run.sh. This script must be copied to the following container directory: /opt/application/run.sh.
- The service must start within 120 seconds. Otherwise, the following error will occur.
- Container file read/write permissions
- If the run-as-user UID of the container is set to root, veFaaS runs your container image as root. If a specific user is specified in your Dockerfile, the container image will not run under that designated user.
- Container image size limit
- The container image must not exceed 10 GiB in size.
Procedure
- Write a Dockerfile in the current directory of your project. The following is a Dockerfile example for an HTTP service written in Go.
- Run the following command to specify the CR instance. In the command, replace IMAGE_NAME with your image name. Assume that the target veFaaS region is China (Beijing) and that your image name is xxx-cn-beijing.cr.volces.com/vefaas/native-image-go:latest.
- Run the following command to build the image.
- Run the following command to push the image to CR.
What to do next
- Create a Web app function in the veFaaS console. When you create the function, set its deployment method to "Image". For detailed steps, see Creating functions.
Last updated: 2026.08.19 14:06:05