mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
--memory is not deprecated, but not supported on buildkit. Issue a Warning and ignore flag
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
3f0ee7072f
commit
e0a828daae
@ -18,6 +18,7 @@ package compose
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
@ -47,6 +48,9 @@ func buildCommand(p *projectOptions) *cobra.Command {
|
|||||||
Use: "build [SERVICE...]",
|
Use: "build [SERVICE...]",
|
||||||
Short: "Build or rebuild services",
|
Short: "Build or rebuild services",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
if opts.memory != "" {
|
||||||
|
fmt.Println("WARNING --memory is ignored as not supported in buildkit.")
|
||||||
|
}
|
||||||
if opts.quiet {
|
if opts.quiet {
|
||||||
devnull, err := os.Open(os.DevNull)
|
devnull, err := os.Open(os.DevNull)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -70,7 +74,7 @@ func buildCommand(p *projectOptions) *cobra.Command {
|
|||||||
cmd.Flags().BoolVar(&opts.noCache, "no-cache", false, "Do not use cache when building the image")
|
cmd.Flags().BoolVar(&opts.noCache, "no-cache", false, "Do not use cache when building the image")
|
||||||
cmd.Flags().Bool("no-rm", false, "Do not remove intermediate containers after a successful build. DEPRECATED")
|
cmd.Flags().Bool("no-rm", false, "Do not remove intermediate containers after a successful build. DEPRECATED")
|
||||||
cmd.Flags().MarkHidden("no-rm") //nolint:errcheck
|
cmd.Flags().MarkHidden("no-rm") //nolint:errcheck
|
||||||
cmd.Flags().StringVarP(&opts.memory, "memory", "m", "", "Set memory limit for the build container. DEPRECATED")
|
cmd.Flags().StringVarP(&opts.memory, "memory", "m", "", "Set memory limit for the build container. Not supported on buildkit yet.")
|
||||||
cmd.Flags().MarkHidden("memory") //nolint:errcheck
|
cmd.Flags().MarkHidden("memory") //nolint:errcheck
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
Loading…
x
Reference in New Issue
Block a user