All Products
Search
Document Center

Function Compute:Configure official public layers

Last Updated:Apr 01, 2026

Packaging all dependencies into every function's deployment package leads to large archives and duplicated effort across functions. Function Compute provides official public layers for common runtimes and dependency libraries. Add a public layer to share dependencies across functions without rebuilding them each time.

Public layers

The tables below list available public layers by category. For the full list, see Public layers. If you need a layer that isn't listed, contact us.

Custom runtimes

These layers provide runtime environments for custom runtimes such as Python 3.10 and Node.js 17. Some layers also bundle common dependency libraries — for example, Python310-Package-Collection includes frequently used Python packages.

Public layerCompatible runtimeDescriptionReferences
PHP81-Debian10Custom.Debian10PHP 8.1 Debian 10 runtime layerREADME.md
PHP80-Debian10Custom.Debian10PHP 8.0 Debian 10 runtime layerREADME.md
NginxCustom.Debian10Nginx Debian 10 runtime layerREADME.md
Python310Custom, Custom.Debian10Python 3.10.5 runtime layerREADME.md
Python310-Package-CollectionCustom.Debian10A collection of common dependency libraries for the Python 3.10 runtimeREADME.md
Python39Custom, Custom.Debian10Python 3.9.13 runtime layerREADME.md
Python39-Package-CollectionCustom, Custom.Debian10A collection of common dependency libraries for the Python 3.9 runtimeREADME.md
Python38Custom, Custom.Debian10Python 3.8.13 runtime layerREADME.md
Python38-Package-CollectionCustom, Custom.Debian10A collection of common dependency libraries for the Python 3.8.13 runtimeREADME.md
Python36CustomPython 3.6.15 runtime layerREADME.md
Python36-Package-CollectionCustomA collection of common dependency libraries for the Python 3.6.15 runtimeREADME.md
Dotnet6Custom, Custom.Debian10ASP.NET 6.0.5 runtime layerREADME.md
PHP72CustomPHP 7.2 runtime layerREADME.md
Java8Custom.Debian10Java 8 runtime layerREADME.md
Java11Custom, Custom.Debian10Java 11 runtime layerREADME.md
Java17Custom, Custom.Debian10Java 17 runtime layerREADME.md
Java21Custom.Debian10Java 21 runtime layerREADME.md
Nodejs20Custom.Debian10Node.js 20 runtime layerREADME.md
Nodejs18Custom.Debian10Node.js 18 runtime layerREADME.md
Nodejs17CustomNode.js 17 runtime layerREADME.md
Nodejs16Custom, Custom.Debian10Node.js 16 runtime layerREADME.md
Nodejs14CustomNode.js 14 runtime layerREADME.md
Nodejs12CustomNode.js 12 runtime layerREADME.md
Go1Custom.Debian10Go 1 runtime layerREADME.md
Go118CustomGo 1.x runtime layerREADME.md

Common dependency libraries

Public layerCompatible runtimeDescriptionCore library versionReferences
Python310-OSS2Python 3.10, Custom.Debian10oss2: OSS SDK for Python-README.md
Python39-OSS2Python 3.9, Custom.Debian10oss2: OSS SDK for Python-README.md
Python310-TensorFlow2xPython 3.10, Custom.Debian10An open source machine learning framework (CPU edition)tensorflow==2.15.0.post1README.md
Python3x-PyMongo4xPython 3.10, Custom.Debian10An open source scientific computing libraryPyMongo==4.6.1README.md
Python3x-Pandas2xPython 3.9, Custom.Debian10An open source data analysis and processing tool based on NumPypandas==2.2.1README.md
Python310-PyTorch2xPython 3.10, Custom.Debian10An open source machine learning framework (CPU edition)torch==2.2.1+cpuREADME.md
Python39-Pandas1xPython 3.9, Custom, Custom.Debian10An open source data analysis and processing tool based on NumPypandas==1.4.3README.md
Python39-SciPy1xPython 3.9, Custom, Custom.Debian10An open source scientific computing libraryscipy==1.9.0, numpy==1.23.2README.md
Python36-SciPy1xPython 3.6, CustomAn open source scientific computing libraryscipy-1.5.4, numpy-1.19.5README.md
Python39-PyTorch1xPython 3.9, Custom, Custom.Debian10An open source machine learning framework (CPU edition)torch==1.12.1+cpu, torchaudio==0.12.1+cpu, torchvision==0.13.1+cpuREADME.md
Python36-PyTorch1xPython 3.6, CustomAn open source machine learning framework (CPU edition)torch==1.10.2+cpu, torchaudio==0.10.2+cpu, torchvision==0.11.3+cpuREADME.md
Python3-Flask2xPython 3.9, Python 3.10, Custom, Custom.Debian10A Python-based lightweight web frameworkflask-v2.2.2README.md
Nodejs-Puppeteer17xNode.js 16, Node.js 14, Custom, Custom.Debian10A Headless Chrome toolpuppeteer-v17.1.0README.md
Nodejs-Puppeteer10xNode.js 14, Node.js 12, Node.js 10, CustomA Headless Chrome toolpuppeteer-v10.2.0README.md
Nodejs-Puppeteer19xCustom.Debian10A Headless Chrome toolpuppeteer-v19.8.5README.md
Python310-Opencv4xPython 3.10, Custom.Debian10A cross-platform library for computer visionopencv_python-4.7.0.68README.md
Python38-PlaywrightCustom.Debian10A tool for web page automationplaywright==1.31.1README.md
Poppler22x-Pdf2imagePython 3.10A library for rendering PDF documentspdf2image-1.16.3, poppler-22.12.0README.md
SQLite3Python 3.9, Node.js 16, Node.js 14, Java 11, Java 8, CustomA lightweight in-process relational database3.41.1README.md
FFmpeg6xPython 3.10, Python 3.9, Node.js 16, Node.js 14, Java 11, Java 8, Custom, Custom.Debian10An open source toolkit for recording, converting, and streaming audio and video6.0README.md
ServerlessDevsPython 3.10, Python 3.9, Python 3, Node.js 16, Node.js 14, Java 11, Java 8, Go 1, .NetCore 3.1, PHP 7.2, Custom, Custom.Debian10An open source serverless platform that provides a robust set of tools for developers2.1.14README.md

Web frameworks

Public layerCompatible runtimeCore library versionReferences
Python3-Flask2xPython 3.9, Python 3.10, Custom, Custom.Debian10flask-2.2.2README.md

Alibaba Cloud SDKs

Public layerCompatible runtimeDescriptionReferences
Python310-Aliyun-SDKPython 3.10, Custom.Debian10Common Alibaba Cloud SDKs for Python 3.10README.md
Python39-Aliyun-SDKPython 3.9, CustomCommon Alibaba Cloud SDKs for Python 3.9README.md
Python36-Aliyun-SDKPython 3.6, CustomCommon Alibaba Cloud SDKs for Python 3.6README.md
Nodejs-Aliyun-SDKNode.js 20, Node.js 18, Node.js 16, Node.js 14, Custom, Custom.Debian10Common Alibaba Cloud SDKs (Node.js 20, Node.js 18, Node.js 16, and Node.js 14)README.md
Aliyun-DataXPython 3.6, Python 3.9, Custom, Custom.Debian10Open source edition of Alibaba Cloud DataWorks Data IntegrationREADME.md

How layers work

A function supports up to five layers in total, combining custom and public layers. When multiple layers are configured, Function Compute merges their contents into the /opt directory in reverse order. If two layers contain files with the same name, the file from the first configured layer takes precedence over files in later layers.

Add a public layer in the console

Prerequisites

Before you begin, ensure that you have:

Add the layer

  1. Log on to the Function Compute console. In the left-side navigation pane, click Functions.

  2. In the top navigation bar, select a region. On the Functions page, click the name of the function you want to configure.

  3. On the function details page, click the Configurations tab.

  4. In the left-side navigation tree, click Layers, then click Modify.

  5. In the Layers panel, click + Add Layer and select Add Official Common Layer. Choose a layer from the Official Common Layer drop-down list and a version from the Layer Version drop-down list, then click Deploy.

Add a public layer using Serverless Devs

Prerequisites

Before you begin, ensure that you have:

Add the layer

  1. Run the following command to list official public layers in a region:

    s cli fc layer list --official --region cn-hangzhou

    The output lists available layers with their ARNs. Copy the ARN of the layer you want to use.

    -
      layerName:         Python39-Aliyun-SDK
      arn:               acs:fc:cn-hangzhou:official:layers/Python39-Aliyun-SDK/versions/3
      version:           3
      acl:               1
      description:       Python3.9 Aliyun SDK layer.
      compatibleRuntime:
        - custom
        - python3.9
        - custom.debian10
    -
      layerName:         Python39-Package-Collection
      arn:               acs:fc:cn-hangzhou:official:layers/Python39-Package-Collection/versions/3
      version:           3
      acl:               1
      description:       Python3.9 package collection layer.
      compatibleRuntime:
        - custom
        - custom.debian10

    Key fields in the output:

    FieldDescription
    layerNameThe name of the layer
    versionThe layer version
    arnThe ARN of the layer version, used when attaching the layer to a function
    aclAccess control: 0 = private, 1 = public
    descriptionA brief description of the layer
    compatibleRuntimeThe runtimes this layer supports
  2. In your project directory, create a s.yaml file and add the layer ARN to the layers field.

    edition: 3.0.0
    name: hello-world-app
    access: "default"
    
    vars: # The global variables
      region: "cn-hangzhou"
    
    resources:
      hello_world:
        component: fc3 # The component name.
        actions:       # The custom execution logic.
        props:
          region: ${vars.region}
          functionName: "emoji"
          description: 'this is a layer demo'
          runtime: "python3.9"
          code: ./code
          handler: index.handler
          memorySize: 512
          timeout: 60
          internetAccess: true
          layers:    # The ARNs of the layers attached to the function.
            - acs:fc:cn-hangzhou:official:layers/Python39-Aliyun-SDK/versions/3
  3. Create a code directory in your project directory and place your function code inside it.

  4. Run the following command to deploy the function with the layer configured:

    s deploy

What's next