Skip to content

Docker installation

For containerized deployment with MongoDB and GPU support

1. Access Latent AI's container repository

Retrieve access token

In order to pull containers or install packages from Latent AI, you'll need to create a personal access token. To do so, follow these steps:

  • Login to the Latent AI Repository

    • Click the Sign in link in the upper right.
    • Select Sign In with SSO.
    • Enter your access credentials.
  • Create your Personal Access Token

    • Click on your profile in the upper right.
    • Select User Token on the left navigation.
    • Select the Access user token button.
    • View your user token name and user token pass code.

You can export the token name and token passcode as environment variables:

export REPOSITORY_TOKEN_NAME=<user_token_name>
export REPOSITORY_TOKEN_PASSCODE=<user_token_pass_code>

Log in to container repository

Log in to Latent AI's container repository with the following command:

docker login repository.latentai.io -u $REPOSITORY_TOKEN_NAME -p $REPOSITORY_TOKEN_PASSCODE

2. Configure environment

.env file

Once you've received your LEIP license key via email, create a .env file with the following variables:

# .env file configuration
HOST_DATA_DIR=/path/to/your/images       # Directory containing your image data
APP_PORT=5151                            # Port for FiftyOne web interface
LEIP_LICENSE_KEY=your_license_key_here   # LEIP license key for assisted labeling

docker-compose.yml file

Copy or download the following docker-compose.yml and place it in the same directory as your .env file:

services:
  mongo:
    image: mongo:7.0
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
      interval: 5s
      timeout: 3s
      retries: 10
    volumes:
      - mongo-data:/data/db

  latent-label:
    build: .
    image: latent-label
    depends_on:
      mongo:
        condition: service_healthy
    gpus: all
    environment:
      NVIDIA_VISIBLE_DEVICES: all
      NVIDIA_DRIVER_CAPABILITIES: compute,utility
      FIFTYONE_DATABASE_URI: mongodb://mongo:27017
      FIFTYONE_DEFAULT_DATASET_DIR: /data
      FIFTYONE_ALLOW_LEGACY_ORCHESTRATORS: "true"
      FIFTYONE_PLUGIN_DIRS: /data/__plugins__
      FIFTYONE_LOG_LEVEL: DEBUG
      LEIP_LICENSE_KEY: ${LEIP_LICENSE_KEY}
    shm_size: "2g"
    ports:
      - "${APP_PORT:-5151}:5151"
    volumes:
      - "${HOST_DATA_DIR:-./data}:/data:rw"

volumes:
  mongo-data:

3. Start services

First-time setup:

docker compose up -d --build

Subsequent starts:

docker compose up -d

Stop services:

docker compose down

After starting, open your browser at:

http://localhost:5151

The FiftyOne interface will launch with the Latent Assisted Label plugin preloaded.

4. Additional Docker commands

Check GPU availability:

docker compose exec latent-label nvidia-smi
View logs:
docker compose logs -f latent-label
Verify plugin installation:
docker compose exec -T latent-label fiftyone plugins list

Note

  • GPU support automatically configured
  • MongoDB data persists in Docker volumes
  • Your HOST_DATA_DIR is mounted to /data in the container
  • Use /data as the path when creating datasets in FiftyOne