Docker Image Repo Migration Scripts

Many enterprise customers require all Docker images to be sourced from their internally maintained Docker repositories (such as Artifactory) rather than external registries. This previously meant manual work to identify, pull, re-tag, and push each image individually - a time-consuming and error-prone process.

Two migration scripts automate this workflow for organizations that need to deploy the platform in restricted network environments.

The Scripts

docker-image-migrate-alpha.sh - For Alpha Application

  • Source: alpha-application/values-dev.yaml
  • Image Structure: Uses the newer container.image format with full image URIs

docker-image-migrate.sh - For Workflow Studio

  • Source: workflow-studio/values-dev.yaml
  • Image Structure: Uses the traditional image.repository and image.tag format

Features

Automated Parsing

Both scripts automatically parse your Helm values files to extract all Docker image references, handling different YAML structures.

Parallel Processing

  • Configurable parallel job execution (default: 4 concurrent jobs)
  • Reduces migration time for large deployments
  • Manages resource usage with job queuing

Progress Tracking

  • Live status display showing migration progress
  • Color-coded status indicators (Pending, Pulling, Tagging, Pushing, Completed, Failed, Skipped)
  • Real-time job count and completion statistics

Error Handling

  • Handles platform-incompatible images gracefully
  • Includes timeout protection and job management
  • Provides detailed error reporting

Migration Reporting

  • Final migration summary with status for each service
  • Clear indication of successful migrations, failures, and skipped images
  • Tabular format for documentation purposes

How to Use

Prerequisites

  • yq - YAML processor for parsing configuration files
  • docker - Docker CLI for image operations
  • Network access to both source and target registries
  • Make sure you are logged in to the repos (docker login)

Basic Usage

For Alpha Application:

./scripts/docker-image-migrate-alpha.sh myregistry.azurecr.io/myproject

For Workflow Studio:

./scripts/docker-image-migrate.sh myregistry.azurecr.io/myproject

Advanced Usage with Custom Parallelism

# Use 8 parallel jobs for faster migration
./scripts/docker-image-migrate-alpha.sh myregistry.azurecr.io/myproject 8

Example Output

=== Docker Image Migration Progress ===
Target repository: myregistry.azurecr.io/myproject
Max parallel jobs: 4

SERVICE                   STATUS          MESSAGE
------------------------- --------------- ------------------------------------------------------------
alpha-backend             COMPLETED       Successfully migrated
alpha-frontend            PUSHING         Pushing to registry
workflow-engine           PULLING         Pulling originalrepo/workflow-engine:v2.1.0
notification-service      PENDING         Waiting to start...

Progress: 15/20 completed | 12 successful | 1 failed | 2 skipped | 4 jobs running

Integration Tips

CI/CD Pipeline Integration

# Example pipeline step
- name: Migrate Docker Images
  run: |
    ./scripts/docker-image-migrate-alpha.sh ${{ secrets.INTERNAL_REGISTRY_URI }} 8
    ./scripts/docker-image-migrate.sh ${{ secrets.INTERNAL_REGISTRY_URI }} 8

The migration scripts are available in the repository and can help organizations that need to deploy the platform in restricted network environments.

2 Likes