Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion pkg/compose/build_bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ func buildWithBake(dockerCli command.Cli) (bool, error) {
_, err = manager.GetPlugin("buildx", dockerCli, &cobra.Command{})
if err != nil {
if errdefs.IsNotFound(err) {
logrus.Warnf("Docker Compose requires buildx plugin to be installed")
logrus.Warnf("buildx Docker CLI plugin not found: falling back to the classic builder. " +
"BuildKit-only build features (multi-arch, secrets, ssh, additional contexts, ...) will not be available")
return false, nil
}
return false, err
Expand Down
10 changes: 5 additions & 5 deletions pkg/compose/build_classic.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,19 @@ func (s *composeService) doBuildImage(ctx context.Context, project *types.Projec
// doesn't implement
func checkClassicBuilderSupported(service types.ServiceConfig) error {
if len(service.Build.Platforms) > 1 {
return fmt.Errorf("the classic builder doesn't support multi-arch build, set DOCKER_BUILDKIT=1 to use BuildKit")
return fmt.Errorf("the classic builder doesn't support multi-arch build; building with BuildKit requires the buildx Docker CLI plugin, and DOCKER_BUILDKIT must not be set to 0")
}
if service.Build.Privileged {
return fmt.Errorf("the classic builder doesn't support privileged mode, set DOCKER_BUILDKIT=1 to use BuildKit")
return fmt.Errorf("the classic builder doesn't support privileged mode; building with BuildKit requires the buildx Docker CLI plugin, and DOCKER_BUILDKIT must not be set to 0")
}
if len(service.Build.AdditionalContexts) > 0 {
return fmt.Errorf("the classic builder doesn't support additional contexts, set DOCKER_BUILDKIT=1 to use BuildKit")
return fmt.Errorf("the classic builder doesn't support additional contexts; building with BuildKit requires the buildx Docker CLI plugin, and DOCKER_BUILDKIT must not be set to 0")
}
if len(service.Build.SSH) > 0 {
return fmt.Errorf("the classic builder doesn't support SSH keys, set DOCKER_BUILDKIT=1 to use BuildKit")
return fmt.Errorf("the classic builder doesn't support SSH keys; building with BuildKit requires the buildx Docker CLI plugin, and DOCKER_BUILDKIT must not be set to 0")
}
if len(service.Build.Secrets) > 0 {
return fmt.Errorf("the classic builder doesn't support secrets, set DOCKER_BUILDKIT=1 to use BuildKit")
return fmt.Errorf("the classic builder doesn't support secrets; building with BuildKit requires the buildx Docker CLI plugin, and DOCKER_BUILDKIT must not be set to 0")
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/e2e/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func TestBuildPlatformsStandardErrors(t *testing.T) {
})
res.Assert(t, icmd.Expected{
ExitCode: 1,
Err: "the classic builder doesn't support multi-arch build, set DOCKER_BUILDKIT=1 to use BuildKit",
Err: "the classic builder doesn't support multi-arch build; building with BuildKit requires the buildx Docker CLI plugin, and DOCKER_BUILDKIT must not be set to 0",
})
})

Expand Down Expand Up @@ -470,7 +470,7 @@ func TestBuildPlatformsStandardErrors(t *testing.T) {
})
res.Assert(t, icmd.Expected{
ExitCode: 1,
Err: "the classic builder doesn't support privileged mode, set DOCKER_BUILDKIT=1 to use BuildKit",
Err: "the classic builder doesn't support privileged mode; building with BuildKit requires the buildx Docker CLI plugin, and DOCKER_BUILDKIT must not be set to 0",
})
})
}
Expand Down
Loading