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

Commit 2bd8ee1

Browse files
authored
Merge pull request #500 from chris-crone/improve-missing-invoc-img-err
Improve missing invoc img err
2 parents 65fb5fd + 5b15183 commit 2bd8ee1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
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)

internal/packager/packing.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ import (
1414
"github.com/pkg/errors"
1515
)
1616

17-
var dockerFile = `FROM docker/cnab-app-base:` + internal.Version + `
18-
COPY . .`
17+
const (
18+
// CNABBaseImageName is the name of the base invocation image.
19+
CNABBaseImageName = "docker/cnab-app-base"
20+
21+
dockerIgnore = "Dockerfile"
22+
)
1923

20-
const dockerIgnore = "Dockerfile"
24+
var dockerFile = `FROM ` + CNABBaseImageName + `:` + internal.Version + `
25+
COPY . .`
2126

2227
func tarAdd(tarout *tar.Writer, path, file string) error {
2328
payload, err := ioutil.ReadFile(file)

0 commit comments

Comments
 (0)