Skip to content

Commit 8aa0116

Browse files
committed
Fix extractImageTag parsing registry port as tag for private registry images
1 parent 4d8a2a3 commit 8aa0116

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

apps/dokploy/pages/api/deploy/[refreshToken].ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,17 @@ export function extractImageTag(dockerImage: string | null) {
319319
return null;
320320
}
321321

322-
const tag = dockerImage.split(":").pop();
323-
return tag === dockerImage ? "latest" : tag;
322+
const lastColonIndex = dockerImage.lastIndexOf(":");
323+
if (lastColonIndex === -1) {
324+
return "latest";
325+
}
326+
327+
const afterColon = dockerImage.substring(lastColonIndex + 1);
328+
if (/^\d{1,5}$/.test(afterColon)) {
329+
return "latest";
330+
}
331+
332+
return afterColon;
324333
}
325334

326335
/**

0 commit comments

Comments
 (0)