Custom Image
    • PDF

    Custom Image

    • PDF

    Article Summary

    Available in VPC

    You can create and execute actions in the user image basis. You can add libraries and image layers to the default runtime and set the settings shared by multiple actions as common images.

    Note
    • Image pull time is not included in the execution time of action.
    • Custom image runtime is only supported in the VPC platform.
    • Only Linux and AMD64 images are supported.

    Create Dockerfile

    To create a Dockerfile, the following items must be included. If any of the following is missing, the action does not operate properly.

    1. Base image from Cloud Functions in FROM
    2. Same WORKDIR settings as in the base image
    3. Same ENTRYPOINT or CMD settings as in the base image

    Base image by runtime

    RuntimeImage pathWORKDIRENTRYPOINTCMDBase OS
    python:3.7cloudfunctions.kr.ncr.ntruss.com/cloudfunctions-python-3.7:[TAG]/["/bin/proxy"]-Rocky Linux 8.7
    nodejs:16cloudfunctions.kr.ncr.ntruss.com/cloudfunctions-nodejs-16:[TAG]/nodejsAction-node --expose-gc app.jsRocky Linux 8.7

    Image Build/Push

    You can build an image using the written Dockerfile and push the image to NAVER Cloud Container Registry.
    The image must include the Container Registry path.

    Image Build

    docker build . -t <image>
    

    Image Push

    To push an image to Container Registry, you need to log in to Container Registry first. For more information, see Container Registry guide.

    docker login -u <NCLOUD_ACCESS_KEY> <registry name>.<region>.ncr.ntruss.com
    
    Password: <NCLOUD_SECRET_KEY>
    
    docker push <image>
    

    Example

    • Dockerfile
    FROM cloudfunctions.kr.ncr.ntruss.com/cloudfunctions-python-3.7:latest
    
    # Installing the required library
    RUN dnf -y update && dnf -y install httpd
    RUN pip install boto3
    
    WORKDIR /
    
    ENTRYPOINT ["/bin/proxy"]
    
    • Build
    docker build . -t my-registry.kr.ncr.ntruss.com/custom-python:1.0.0
    
    • Push
    docker login -u *** my-registry.kr.ncr.ntruss.com
    password: ****
    
    docker push my-registry.kr.ncr.ntruss.com/custom-python:1.0.0
    

    Create Custom Image actions

    To create a Custom Image action, select custom image in the runtime.
    You can select the image in the NAVER Cloud Container Registry in the Select Container Registry image or directly enter the path of the image to be used.

    Caution
    • Once an image is selected for an action, overwriting the image does not affect the action. To apply a new image, you need to newly select and save the image in Edit action.
    • If you delete the image selected for an action, the action may not be executed properly.

    cloudfunctions-example-customimages_01.png

    Select Container Registry image

    You can select an image to use by following these steps.
    Click [Complete] to verify whether the image is usable. An image with a compressed size that exceeds 800 MB cannot be used.

    • Select registry
      cloudfunctions-example-customimages_02.png

    • Select image
      cloudfunctions-example-customimages_03.png

    • Select tag
      cloudfunctions-example-customimages_04.png

    Enter Container Registry image path

    You can directly enter the path of the image to use. The image path format is <registry>/<image>:<tag>. If you leave out tag, it is automatically filled in with "latest."

    Verify path

    You can verify the usability of the entered image in the path. The verification conditions are as follows:

    • Compressed size of image must be 800 MB or smaller
    • Must be base image from Cloud Functions

    Image Packs

    The following specialized images are provided in Cloud Functions. You can use them in Custom Image runtime. The provided images can be used as base images.

    ImageDescriptionPathBase runtime
    Headless Chrome PuppeteerThe Node.js environment to use Headless Chrome and Puppeteer is provided.Korea: cloudfunctions.kr.ncr.ntruss.com/headless-chrome-puppeteer:[TAG]
    Singapore: cloudfunctions.sg.ncr.ntruss.com/headless-chrome-puppeteer:[TAG]
    Japan: cloudfunctions.jpn.ncr.naverncp.com/headless-chrome-puppeteer:[TAG]
    nodejs:16

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.