Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/client/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
"Re-run with '--pull-policy=always' to silence this warning.")
}

if !opts.Publish && usesContainerdStorage(c.docker) {
if !opts.Publish && usesContainerdStorage(c.docker) && !logging.IsQuiet(c.logger) {
c.logger.Warnf("Exporting to docker daemon (building without --publish) and daemon uses containerd storage; performance may be significantly degraded.\n" +
"For more information, see https://github.com/buildpacks/pack/issues/2272.")
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/create_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ func testCreateBuilder(t *testing.T, when spec.G, it spec.S) {
}

err := subject.CreateBuilder(context.TODO(), opts)
h.AssertError(t, err, "could not find a target that matches daemon os=linux and architecture=amd64")
h.AssertError(t, err, "the requested target(s)")
})
})

Expand Down Expand Up @@ -1463,7 +1463,7 @@ func testCreateBuilder(t *testing.T, when spec.G, it spec.S) {
}

err := subject.CreateBuilder(context.TODO(), opts)
h.AssertError(t, err, "could not find a target that matches daemon os=linux and architecture=arm64")
h.AssertError(t, err, "the requested target(s)")
})
})
})
Expand Down
18 changes: 17 additions & 1 deletion pkg/client/package_buildpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,21 @@ func (c *Client) daemonTarget(ctx context.Context, targets []dist.Target) (dist.
return t, nil
}
}
return dist.Target{}, errors.Errorf("could not find a target that matches daemon os=%s and architecture=%s", serverResult.Os, serverResult.Arch)
requestedTargets := ""
for i, t := range targets {
if i > 0 {
requestedTargets += ", "
}
if t.Arch != "" {
requestedTargets += fmt.Sprintf("%s/%s", t.OS, t.Arch)
} else {
requestedTargets += t.OS
}
}
return dist.Target{}, errors.Errorf(
"the requested target(s) %s do not match the local Docker daemon's os=%s and architecture=%s; "+
"to build for a different architecture, use the --publish flag to save the image to a registry instead of the daemon "+
"(a local registry can be used for testing purposes)",
style.Symbol(requestedTargets), style.Symbol(serverResult.Os), style.Symbol(serverResult.Arch),
)
}
4 changes: 2 additions & 2 deletions pkg/client/package_buildpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ func testPackageBuildpack(t *testing.T, when spec.G, it spec.S) {
Targets: targets,
PullPolicy: image.PullNever,
})
h.AssertError(t, err, "could not find a target that matches daemon os=linux and architecture=amd64")
h.AssertError(t, err, "the requested target(s)")
})
})

Expand Down Expand Up @@ -1046,7 +1046,7 @@ func testPackageBuildpack(t *testing.T, when spec.G, it spec.S) {
Targets: targets,
PullPolicy: image.PullNever,
})
h.AssertError(t, err, "could not find a target that matches daemon os=linux and architecture=arm64")
h.AssertError(t, err, "the requested target(s)")
})
})
})
Expand Down
Loading