diff --git a/pkg/client/build.go b/pkg/client/build.go index b4fc5c126..0750d5e5c 100644 --- a/pkg/client/build.go +++ b/pkg/client/build.go @@ -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.") } diff --git a/pkg/client/create_builder_test.go b/pkg/client/create_builder_test.go index 1eb51cf45..ba819ee91 100644 --- a/pkg/client/create_builder_test.go +++ b/pkg/client/create_builder_test.go @@ -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)") }) }) @@ -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)") }) }) }) diff --git a/pkg/client/package_buildpack.go b/pkg/client/package_buildpack.go index 4ef96d3ab..27bb0c225 100644 --- a/pkg/client/package_buildpack.go +++ b/pkg/client/package_buildpack.go @@ -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), + ) } diff --git a/pkg/client/package_buildpack_test.go b/pkg/client/package_buildpack_test.go index dd94f0946..71d67d0ca 100644 --- a/pkg/client/package_buildpack_test.go +++ b/pkg/client/package_buildpack_test.go @@ -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)") }) }) @@ -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)") }) }) })