Skip to content

Conversation

ensarkurrt
Copy link
Contributor

@ensarkurrt ensarkurrt commented Jul 16, 2025

Summary

This PR adds a new "registry" provider to the application general settings that allows users to deploy applications directly from Docker registries. The feature includes:

  • Registry selection dropdown that lists available registries
  • Image catalog fetching from selected registry using Docker Registry API v2
  • Tag selection for specific images
  • Complete deployment pipeline integration for registry-based deployments

Changes Made

Database Schema

  • Extended application schema with registry deployment fields (deployRegistryId, deployImage, deployImageTag)
  • Added "registry" to sourceType enum
  • Updated validation schemas and API schemas

Backend Implementation

  • Registry API Service (packages/server/src/services/registry.ts):

    • fetchRegistryImages(): Fetches images from registry using /v2/_catalog endpoint
    • fetchImageTags(): Fetches tags using /v2/{image}/tags/list endpoint
  • tRPC Router Extensions (apps/dokploy/server/api/routers/application.ts):

    • saveRegistryProvider: Saves registry deployment configuration
    • getRegistryImages: Fetches available images from selected registry
    • getImageTags: Fetches tags for selected image
    • getUserRegistries: Lists user's available registries
  • Deployment Pipeline (packages/server/src/utils/providers/docker.ts):

    • buildRegistry(): Handles local registry deployments
    • buildRemoteRegistry(): Handles remote registry deployments
    • Proper Docker image name formatting with protocol stripping
  • Container Management (packages/server/src/utils/builders/index.ts):

    • Updated getImageName() to handle registry source type
    • Updated getAuthConfig() for registry authentication
    • Fixed Docker Swarm service creation for registry deployments

Frontend Implementation

  • Registry Provider Component (apps/dokploy/components/dashboard/application/general/generic/save-registry-provider.tsx):

    • Cascading dropdown interface (Registry → Image → Tag)
    • React Hook Form integration with Zod validation
    • Real-time data fetching with tRPC
    • Proper error handling and loading states
  • Integration: Added registry provider to application general settings

Screenshots

Registry Configuration Interface

CleanShot 2025-07-16 at 15 37 27 *Screenshot showing the registry provider interface with registry selection, image catalog, and tag selection dropdowns*

Deployment Process

CleanShot 2025-07-16 at 15 37 38 *Screenshot showing successful deployment logs with registry image pulling and container creation*

Running Container

CleanShot 2025-07-16 at 15 37 55 *Screenshot showing the successfully deployed container running from registry image*

Test Plan

  • Registry selection and image fetching
  • Tag selection and deployment configuration
  • Local registry deployment workflow
  • Remote registry deployment workflow
  • Docker image name formatting and protocol handling
  • Authentication with private registries
  • Container creation and startup
  • Integration with existing deployment pipeline

Technical Details

Docker Image Naming

The implementation correctly handles Docker image naming by:

  • Stripping protocols (https://, http://) from registry URLs
  • Supporting optional image prefixes for organized namespaces
  • Proper format: registry.host/[prefix/]image:tag

Registry API Integration

  • Uses Docker Registry API v2 for catalog and tag fetching
  • Handles authentication for private registries
  • Proper error handling for network and API failures

Deployment Pipeline

  • Seamless integration with existing Docker deployment workflow
  • Supports both local and remote deployment scenarios
  • Proper authentication configuration for Docker Swarm services

Breaking Changes

None. This is a new feature that extends existing functionality without modifying current behavior.

Related Issues

Closes #2204 - [Feature Request] Add Registry Provider for Application Deployments

@ensarkurrt ensarkurrt requested a review from Siumauricio as a code owner July 16, 2025 13:07
Copy link
Contributor

@Siumauricio Siumauricio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, it looks good, but it seems that it only works with private registries such as AWS ECR, DigitalOcean Registry, etc. It doesn't work for Docker Hub.

I wonder if it would be better to put this autocomplete feature in the Docker provider section, since I don't think it's necessary to create a new provider for this case?

@Siumauricio
Copy link
Contributor

This is still in progress? @ensarkurrt

@ensarkurrt
Copy link
Contributor Author

Hey, it looks good, but it seems that it only works with private registries such as AWS ECR, DigitalOcean Registry, etc. It doesn't work for Docker Hub.

I wonder if it would be better to put this autocomplete feature in the Docker provider section, since I don't think it's necessary to create a new provider for this case?

Hello, you're right. I will replace the current provider with the new provider I created.

And I will test and develop for Docker Hub. The new provider receives the registries from the Dokploy system. If we can add Docker Hub to Dokploy registries, the provider can work 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add Registry Provider for Application Deployments
2 participants