Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 5b15183

Browse files
committed
Improve invocation image not found error
Previously when the invocation image could not be found, Docker App would output: manifest for docker/cnab-app-base:v0.6.0-202-gbaf0b246c7 not found This is confusing to users who are not familiar with manifests. The new error will indicate that Docker App needs an image. Signed-off-by: Christopher Crone <[email protected]>
1 parent 2e4b6d8 commit 5b15183

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/commands/bundle.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"io/ioutil"
99

1010
"github.com/deislabs/duffle/pkg/bundle"
11+
"github.com/docker/app/internal"
1112
"github.com/docker/app/internal/packager"
1213
"github.com/docker/app/types"
1314
"github.com/docker/app/types/metadata"
@@ -90,6 +91,11 @@ func makeBundleFromApp(dockerCli command.Cli, app *types.App) (*bundle.Bundle, e
9091
defer buildResp.Body.Close()
9192

9293
if err := jsonmessage.DisplayJSONMessagesStream(buildResp.Body, ioutil.Discard, 0, false, func(jsonmessage.JSONMessage) {}); err != nil {
94+
// If the invocation image can't be found we will get an error of the form:
95+
// manifest for docker/cnab-app-base:v0.6.0-202-gbaf0b246c7 not found
96+
if err.Error() == fmt.Sprintf("manifest for %s:%s not found", packager.CNABBaseImageName, internal.Version) {
97+
return nil, fmt.Errorf("unable to resolve Docker App base image: %s:%s", packager.CNABBaseImageName, internal.Version)
98+
}
9399
return nil, err
94100
}
95101
return packager.ToCNAB(app, invocationImageName)

0 commit comments

Comments
 (0)