Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit e0a828d

Browse files
committed
--memory is not deprecated, but not supported on buildkit. Issue a Warning and ignore flag
Signed-off-by: Guillaume Tardif <[email protected]>
1 parent 3f0ee70 commit e0a828d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: cli/cmd/compose/build.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package compose
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"os"
2223

2324
"github.com/compose-spec/compose-go/types"
@@ -47,6 +48,9 @@ func buildCommand(p *projectOptions) *cobra.Command {
4748
Use: "build [SERVICE...]",
4849
Short: "Build or rebuild services",
4950
RunE: func(cmd *cobra.Command, args []string) error {
51+
if opts.memory != "" {
52+
fmt.Println("WARNING --memory is ignored as not supported in buildkit.")
53+
}
5054
if opts.quiet {
5155
devnull, err := os.Open(os.DevNull)
5256
if err != nil {
@@ -70,7 +74,7 @@ func buildCommand(p *projectOptions) *cobra.Command {
7074
cmd.Flags().BoolVar(&opts.noCache, "no-cache", false, "Do not use cache when building the image")
7175
cmd.Flags().Bool("no-rm", false, "Do not remove intermediate containers after a successful build. DEPRECATED")
7276
cmd.Flags().MarkHidden("no-rm") //nolint:errcheck
73-
cmd.Flags().StringVarP(&opts.memory, "memory", "m", "", "Set memory limit for the build container. DEPRECATED")
77+
cmd.Flags().StringVarP(&opts.memory, "memory", "m", "", "Set memory limit for the build container. Not supported on buildkit yet.")
7478
cmd.Flags().MarkHidden("memory") //nolint:errcheck
7579

7680
return cmd

0 commit comments

Comments
 (0)