Custom Image

Prev Next

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 inFROM
  2. Same WORKDIR settings as in the base image
  3. Same ENTRYPOINT or CMD settings as in the base image

Base image by runtime

Runtime Image path WORKDIR ENTRYPOINT CMD Base OS
python:3.7 cloudfunctions.kr.ncr.ntruss.com/cloudfunctions-python-3.7:[TAG] / ["/bin/proxy"] - Rocky Linux 8.7
nodejs:16 cloudfunctions.kr.ncr.ntruss.com/cloudfunctions-nodejs-16:[TAG] /nodejsAction - node --expose-gc app.js Rocky 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. For more information, see Container Registry user 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 action

To create a Custom Image action, select custom image in the runtime.
You can select the image in 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-customimage_v2_01_ko

Select Container Registry image

You can select an image to use by following the next 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 manually 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.

Image Description Path Base runtime
Headless Chrome Puppeteer The 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