Custom Docker Image
  • 24 Jan 2025
  • Dark
    Light
  • PDF

Custom Docker Image

  • Dark
    Light
  • PDF

Article summary

Overview

Dataloop allows you to deploy custom Docker images within the application module, enabling you to enhance your application with any functionality needed for your project. You can seamlessly use both public and private Docker registries from AWS or GCP.

Deploying a Docker image is simple—just provide the Docker image path when setting up the service.

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

Use Your Private Docker Registry by Deploying It to an Application Service

To deploy your docker image, ensure you have integrated them with Dataloop platform, connect your docker to Dataloop using private docker registries. We support the following docker registry integrations:

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

  1. Select Marketplace from the left-side menu.
  2. Click Actions -> Create an Application.
  3. Perform the steps mentioned Create an Application.
  4. Verify you are in the Services tab, and click Create Application.
  5. Click App Config.
  1. Insert the relevant URL in the Docker image field.
  1. Complete the remaining steps.

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 application, 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 \


What's Next