Skip to content

Commit d21968e

Browse files
committed
fix(cli): push localhost registry images in self-hosted local builds
1 parent 774007e commit d21968e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/cli-v3/src/deploy/buildImage.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,9 @@ const BuildKitMetadata = z.object({
10761076
"image.name": z.string().optional(),
10771077
});
10781078

1079-
// Don't push if the image tag is a local address, unless the user explicitly wants to push
1079+
// Self-hosted installations commonly use a local registry such as localhost:5000.
1080+
// In that case we still need to push, otherwise the deployment can complete while the
1081+
// supervisor later fails with "No such image".
10801082
function shouldPush(imageTag: string, push?: boolean) {
10811083
switch (push) {
10821084
case true: {
@@ -1086,11 +1088,7 @@ function shouldPush(imageTag: string, push?: boolean) {
10861088
return false;
10871089
}
10881090
case undefined: {
1089-
return imageTag.startsWith("localhost") ||
1090-
imageTag.startsWith("127.0.0.1") ||
1091-
imageTag.startsWith("0.0.0.0")
1092-
? false
1093-
: true;
1091+
return true;
10941092
}
10951093
default: {
10961094
assertExhaustive(push);

0 commit comments

Comments
 (0)