Custom Docker Image
  • 28 Feb 2024
  • Dark
    Light
  • PDF

Custom Docker Image

  • Dark
    Light
  • PDF

Article summary

Overview

Dataloop enables you to deploy in the FaaS module a custom docker image, to enrich your application with literally anything required for your project.
Deploying a Docker image is as easy as providing the Docker image path when deploying the service:

service = package.deploy(
    service_name='my-service',
    runtime=dl.KubernetesRuntime(
      runner_image='gcr.io/google.com/cloudsdktool/cloud-sdk:latest'
    )
)

Deploy Docker Image to FaaS Service

After the cloud storage connection, its deployment is performed as follows:

  1. Select CloudOps from the main menu.
  2. Verify you are in the Services tab, and click Create Application.
  3. Click App Config.
  1. Insert the relevant URL in the Docker image field.

PIP vs PIP3

When the service runner installs its requirement, it uses pip to install, therefore the service can fail if you do not migrate packages installed via pip to pip3. To avoid installation issues, add the lines below to your Dockerfile.

RUN apt-get -y update \
  && apt-get install -y python3-pip python3-dev \
  && ln -s /usr/bin/python3 python \
  && ln -s /usr/bin/pip3 pip \

Root Access

When building a docker image indented to work with the Dataloop FaaS, all packages must be installed using the --user option, to have root user permissions.

RUN pip3 install --user 
  asynctest==0.13.0 
  boto3==1.21.45 
  dtlpy \

Using Private Docker Registry

Connect your docker to Dataloop using GCR (GCP) private docker registries.

  1. Create an Organization-Integration of a private container registry type.
  2. Specify the docker image details in the FaaS application-configuration.

What's Next