Skip to content

feat(docker): pull images with stored registry credentials#103

Merged
AminDhouib merged 3 commits into
canaryfrom
port/upr-3678
Jul 16, 2026
Merged

feat(docker): pull images with stored registry credentials#103
AminDhouib merged 3 commits into
canaryfrom
port/upr-3678

Conversation

@AminDhouib

Copy link
Copy Markdown
Member

Summary

Lets a Docker-source application reference a stored registry so its credentials are used to docker login before the image is pulled — instead of forcing inline username/password on the app. Applies to both deploy paths.

  • packages/server/src/db/schema/application.ts: add registryId to the apiSaveDockerProvider input.
  • apps/dokploy/server/api/routers/application.ts (saveDockerProvider): when a registryId is chosen, persist it and clear inline username/password/registryUrl; otherwise persist the inline credentials and clear registryId.
  • packages/server/src/utils/builders/index.ts (getAuthConfig): for sourceType === "docker", resolve the selected registry's credentials for the Swarm authconfig.
  • packages/server/src/utils/providers/docker.ts (buildRemoteDocker): resolve the selected registry's credentials for the remote docker login/pull.
  • apps/dokploy/components/dashboard/application/general/generic/save-docker-provider.tsx: registry selector in the Docker provider form.

Ports Dokploy#3678 by @AceRRR10 (manual apply; upstream co-authored).

Adaptations

The fork's registry model differs from upstream, so this is a manual adaptation rather than a cherry-pick:

  • Credentials loaded on demand. The fork deliberately excludes registry passwords from relational queries (registry: { columns: { password: false } }), so instead of reading registry.password off the loaded relation (upstream's approach), getAuthConfig and buildRemoteDocker fetch credentials via the fork's existing findRegistryByIdWithCredentials(registryId).
  • Kept the fork's safeDockerLoginCommand for the remote login (upstream reverted to a raw docker login string).
  • Skipped upstream's image-name auto-concatenation churn (commits that add then revert prefixing the registry URL onto the image): the fork's getImageName / uploadImageRemoteCommand already use the docker image reference as-is and getRegistryTag already lowercases, so upload.ts needed no change.

Notes

  • Uses the existing registryId column and already-loaded registry relation — no database migration (this item's reserved slot 0186 stays unused) and no new relational query on applications.

Verification

  • pnpm --filter=dokploy run typecheck passes on this branch.

AminDhouib and others added 3 commits July 12, 2026 16:28
Adds the ability to attach a stored registry to a Docker-source application so
its credentials are used for `docker login` before pulling the image, in both
the Swarm authconfig path (getAuthConfig) and the remote docker pull path
(buildRemoteDocker). The provider form gains a registry selector.

Manual port of Dokploy#3678 adapted to the fork's registry model:
credentials are loaded on demand via findRegistryByIdWithCredentials (the fork
excludes registry passwords from relational queries) and login keeps the fork's
safeDockerLoginCommand. Upstream's image-name auto-concatenation churn was
skipped because the fork already resolves docker image names as-is.

Co-authored-by: AceRRR10 <darioacerr@gmail.com>
# Conflicts:
#	apps/dokploy/components/dashboard/application/general/generic/save-docker-provider.tsx
#	apps/dokploy/server/api/routers/application.ts
#	packages/server/src/utils/providers/docker.ts
@AminDhouib
AminDhouib merged commit 39824ce into canary Jul 16, 2026
3 checks passed
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.

1 participant