Repository: docker/compose-cli
Pull request #1390 (2021-03-04 05:48:42)

Add `quietPull` option to `up`
**What I did**
Add `quietPull` option to `up`

Resolves https://github.com/docker/compose-cli/issues/1368
Depends on https://github.com/docker/buildx/pull/558

gtardif: This is waiting on https://github.com/docker/buildx/pull/558

Patch:
diff --git a/aci/compose.go b/aci/compose.go
index 65343670..f004ddbd 100644
--- a/aci/compose.go
+++ b/aci/compose.go
@@ -48,7 +48,7 @@ func (cs *aciComposeService) Build(ctx context.Context, project *types.Project,
 	return errdefs.ErrNotImplemented
 }
 
-func (cs *aciComposeService) Push(ctx context.Context, project *types.Project, options compose.PushOptions) error {
+func (cs *aciComposeService) Push(ctx context.Context, project *types.Project) error {
 	return errdefs.ErrNotImplemented
 }
 
@@ -226,10 +226,3 @@ func (cs *aciComposeService) Remove(ctx context.Context, project *types.Project,
 func (cs *aciComposeService) Exec(ctx context.Context, project *types.Project, opts compose.RunOptions) error {
 	return errdefs.ErrNotImplemented
 }
-func (cs *aciComposeService) Top(ctx context.Context, projectName string, services []string) ([]compose.ContainerProcSummary, error) {
-	return nil, errdefs.ErrNotImplemented
-}
-
-func (cs *aciComposeService) Events(ctx context.Context, project string, options compose.EventsOptions) error {
-	return errdefs.ErrNotImplemented
-}
diff --git a/api/client/compose.go b/api/client/compose.go
index c5b1dca3..f68378b8 100644
--- a/api/client/compose.go
+++ b/api/client/compose.go
@@ -32,7 +32,7 @@ func (c *composeService) Build(ctx context.Context, project *types.Project, opti
 	return errdefs.ErrNotImplemented
 }
 
-func (c *composeService) Push(ctx context.Context, project *types.Project, options compose.PushOptions) error {
+func (c *composeService) Push(ctx context.Context, project *types.Project) error {
 	return errdefs.ErrNotImplemented
 }
 
@@ -99,11 +99,3 @@ func (c *composeService) Pause(ctx context.Context, project *types.Project) erro
 func (c *composeService) UnPause(ctx context.Context, project *types.Project) error {
 	return errdefs.ErrNotImplemented
 }
-
-func (c *composeService) Top(ctx context.Context, projectName string, services []string) ([]compose.ContainerProcSummary, error) {
-	return nil, errdefs.ErrNotImplemented
-}
-
-func (c *composeService) Events(ctx context.Context, project string, options compose.EventsOptions) error {
-	return errdefs.ErrNotImplemented
-}
diff --git a/api/compose/api.go b/api/compose/api.go
index 1f958c51..e2840f6d 100644
--- a/api/compose/api.go
+++ b/api/compose/api.go
@@ -18,7 +18,6 @@ package compose
 
 import (
 	"context"
-	"fmt"
 	"io"
 	"strings"
 	"time"
@@ -31,7 +30,7 @@ type Service interface {
 	// Build executes the equivalent to a `compose build`
 	Build(ctx context.Context, project *types.Project, options BuildOptions) error
 	// Push executes the equivalent ot a `compose push`
-	Push(ctx context.Context, project *types.Project, options PushOptions) error
+	Push(ctx context.Context, project *types.Project) error
 	// Pull executes the equivalent of a `compose pull`
 	Pull(ctx context.Context, project *types.Project) error
 	// Create executes the equivalent to a `compose create`
@@ -64,10 +63,6 @@ type Service interface {
 	Pause(ctx context.Context, project *types.Project) error
 	// UnPause executes the equivalent to a `compose unpause`
 	UnPause(ctx context.Context, project *types.Project) error
-	// Top executes the equivalent to a `compose top`
-	Top(ctx context.Context, projectName string, services []string) ([]ContainerProcSummary, error)
-	// Events executes the equivalent to a `compose events`
-	Events(ctx context.Context, project string, options EventsOptions) error
 }
 
 // BuildOptions group options of the Build API
@@ -94,6 +89,8 @@ type CreateOptions struct {
 	Inherit bool
 	// Timeout set delay to wait for container to gracelfuly stop before sending SIGKILL
 	Timeout *time.Duration
+	// QuietPull makes the pulling process quiet
+	QuietPull bool
 }
 
 // StartOptions group options of the Start API
@@ -114,6 +111,8 @@ type StopOptions struct {
 type UpOptions struct {
 	// Detach will create services and return immediately
 	Detach bool
+	// QuietPull makes the pulling process quiet
+	QuietPull bool
 }
 
 // DownOptions group options of the Down API
@@ -138,11 +137,6 @@ type ConvertOptions struct {
 	Output string
 }
 
-// PushOptions group options of the Push API
-type PushOptions struct {
-	IgnoreFailures bool
-}
-
 // KillOptions group options of the Kill API
 type KillOptions struct {
 	// Signal to send to containers
@@ -159,52 +153,26 @@ type RemoveOptions struct {
 	Force bool
 }
 
-// RunOptions group options of the Run API
+// RunOptions options to execute compose run
 type RunOptions struct {
-	Name              string
-	Service           string
-	Command           []string
-	Entrypoint        []string
-	Detach            bool
-	AutoRemove        bool
-	Writer            io.Writer
-	Reader            io.Reader
-	Tty               bool
-	WorkingDir        string
-	User              string
-	Environment       []string
-	Labels            types.Labels
-	Privileged        bool
-	UseNetworkAliases bool
+	Name        string
+	Service     string
+	Command     []string
+	Entrypoint  []string
+	Detach      bool
+	AutoRemove  bool
+	Writer      io.Writer
+	Reader      io.Reader
+	Tty         bool
+	WorkingDir  string
+	User        string
+	Environment []string
+	Labels      types.Labels
+	Privileged  bool
 	// used by exec
 	Index int
 }
 
-// EventsOptions group options of the Events API
-type EventsOptions struct {
-	Services []string
-	Consumer func(event Event) error
-}
-
-// Event is a container runtime event served by Events API
-type Event struct {
-	Timestamp  time.Time
-	Service    string
-	Container  string
-	Status     string
-	Attributes map[string]string
-}
-
-func (e Event) String() string {
-	t := e.Timestamp.Format("2006-01-02 15:04:05.000000")
-	var attr []string
-	for k, v := range e.Attributes {
-		attr = append(attr, fmt.Sprintf("%s=%s", k, v))
-	}
-	return fmt.Sprintf("%s container %s %s (%s)\n", t, e.Status, e.Container, strings.Join(attr, ", "))
-
-}
-
 // EnvironmentMap return RunOptions.Environment as a MappingWithEquals
 func (opts *RunOptions) EnvironmentMap() types.MappingWithEquals {
 	environment := types.MappingWithEquals{}
@@ -250,14 +218,6 @@ type ContainerSummary struct {
 	Publishers []PortPublisher
 }
 
-// ContainerProcSummary holds container processes top data
-type ContainerProcSummary struct {
-	ID        string
-	Name      string
-	Processes [][]string
-	Titles    []string
-}
-
 // ServiceStatus hold status about a service
 type ServiceStatus struct {
 	ID         string
diff --git a/api/context/context.go b/api/context/context.go
index 27ac5e36..b1138c31 100644
--- a/api/context/context.go
+++ b/api/context/context.go
@@ -20,12 +20,9 @@ import (
 	gocontext "context"
 
 	"golang.org/x/net/context"
-
-	cliflags "github.com/docker/cli/cli/flags"
 )
 
 type currentContextKey struct{}
-type cliOptionsKey struct{}
 
 // WithCurrentContext sets the name of the current docker context
 func WithCurrentContext(ctx gocontext.Context, contextName string) context.Context {
@@ -37,14 +34,3 @@ func CurrentContext(ctx context.Context) string {
 	cc, _ := ctx.Value(currentContextKey{}).(string)
 	return cc
 }
-
-// WithCliOptions sets CLI options
-func WithCliOptions(ctx gocontext.Context, options cliflags.CommonOptions) context.Context {
-	return context.WithValue(ctx, cliOptionsKey{}, options)
-}
-
-// CliOptions returns common cli options
-func CliOptions(ctx context.Context) cliflags.CommonOptions {
-	cc, _ := ctx.Value(cliOptionsKey{}).(cliflags.CommonOptions)
-	return cc
-}
diff --git a/builder.Makefile b/builder.Makefile
index be8e0a00..da3971e4 100644
--- a/builder.Makefile
+++ b/builder.Makefile
@@ -95,7 +95,3 @@ package: cross
 	cp $(BINARY)-windows-amd64.exe $(WORK_DIR)/docker.exe
 	rm -f dist/docker-windows-amd64.zip && zip dist/docker-windows-amd64.zip -j packaging/LICENSE $(WORK_DIR)/docker.exe
 	rm -r $(WORK_DIR)
-
-.PHONY: yamldocs
-yamldocs:
-	go run docs/yaml/main/generate.go
\ No newline at end of file
diff --git a/cli/cmd/compose/compose.go b/cli/cmd/compose/compose.go
index c6b18039..7f01f8c5 100644
--- a/cli/cmd/compose/compose.go
+++ b/cli/cmd/compose/compose.go
@@ -27,7 +27,6 @@ import (
 	"github.com/spf13/pflag"
 
 	"github.com/docker/compose-cli/api/context/store"
-	"github.com/docker/compose-cli/cli/formatter"
 )
 
 // Warning is a global warning to be displayed to user on command failure
@@ -101,13 +100,11 @@ func (o *projectOptions) toProjectOptions() (*cli.ProjectOptions, error) {
 // Command returns the compose command with its child commands
 func Command(contextType string) *cobra.Command {
 	opts := projectOptions{}
-	var ansi string
 	command := &cobra.Command{
 		Short:            "Docker Compose",
 		Use:              "compose",
 		TraverseChildren: true,
 		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
-			formatter.SetANSIMode(ansi)
 			if opts.WorkDir != "" {
 				if opts.ProjectDir != "" {
 					return errors.New(aec.Apply(`cannot specify DEPRECATED "--workdir" and "--project-directory". Please use only "--project-directory" instead.`, aec.RedF))
@@ -138,8 +135,6 @@ func Command(contextType string) *cobra.Command {
 		execCommand(&opts),
 		pauseCommand(&opts),
 		unpauseCommand(&opts),
-		topCommand(&opts),
-		eventsCommand(&opts),
 	)
 
 	if contextType == store.LocalContextType || contextType == store.DefaultContextType {
@@ -152,6 +147,5 @@ func Command(contextType string) *cobra.Command {
 	}
 	command.Flags().SetInterspersed(false)
 	opts.addProjectFlags(command.Flags())
-	command.Flags().StringVar(&ansi, "ansi", "auto", `Control when to print ANSI control characters ("never"|"always"|"auto")`)
 	return command
 }
diff --git a/cli/cmd/compose/events.go b/cli/cmd/compose/events.go
deleted file mode 100644
index e37b150a..00000000
--- a/cli/cmd/compose/events.go
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package compose
-
-import (
-	"context"
-	"encoding/json"
-	"fmt"
-
-	"github.com/docker/compose-cli/api/client"
-	"github.com/docker/compose-cli/api/compose"
-
-	"github.com/spf13/cobra"
-)
-
-type eventsOpts struct {
-	*composeOptions
-	json bool
-}
-
-func eventsCommand(p *projectOptions) *cobra.Command {
-	opts := eventsOpts{
-		composeOptions: &composeOptions{
-			projectOptions: p,
-		},
-	}
-	cmd := &cobra.Command{
-		Use:   "events [options] [--] [SERVICE...]",
-		Short: "Receive real time events from containers.",
-		RunE: func(cmd *cobra.Command, args []string) error {
-			return runEvents(cmd.Context(), opts, args)
-		},
-	}
-
-	cmd.Flags().BoolVar(&opts.json, "json", false, "Output events as a stream of json objects")
-	return cmd
-}
-
-func runEvents(ctx context.Context, opts eventsOpts, services []string) error {
-	c, err := client.NewWithDefaultLocalBackend(ctx)
-	if err != nil {
-		return err
-	}
-
-	project, err := opts.toProjectName()
-	if err != nil {
-		return err
-	}
-
-	return c.ComposeService().Events(ctx, project, compose.EventsOptions{
-		Services: services,
-		Consumer: func(event compose.Event) error {
-			if opts.json {
-				marshal, err := json.Marshal(map[string]interface{}{
-					"time":       event.Timestamp,
-					"type":       "container",
-					"service":    event.Service,
-					"id":         event.Container,
-					"action":     event.Status,
-					"attributes": event.Attributes,
-				})
-				if err != nil {
-					return err
-				}
-				fmt.Println(string(marshal))
-			} else {
-				fmt.Println(event)
-			}
-			return nil
-		},
-	})
-}
diff --git a/cli/cmd/compose/push.go b/cli/cmd/compose/push.go
index 21c6f1ee..407f8836 100644
--- a/cli/cmd/compose/push.go
+++ b/cli/cmd/compose/push.go
@@ -22,15 +22,12 @@ import (
 	"github.com/spf13/cobra"
 
 	"github.com/docker/compose-cli/api/client"
-	"github.com/docker/compose-cli/api/compose"
 	"github.com/docker/compose-cli/api/progress"
 )
 
 type pushOptions struct {
 	*projectOptions
 	composeOptions
-
-	Ignorefailures bool
 }
 
 func pushCommand(p *projectOptions) *cobra.Command {
@@ -44,8 +41,6 @@ func pushCommand(p *projectOptions) *cobra.Command {
 			return runPush(cmd.Context(), opts, args)
 		},
 	}
-	pushCmd.Flags().BoolVar(&opts.Ignorefailures, "ignore-push-failures", false, "Push what it can and ignores images with push failures")
-
 	return pushCmd
 }
 
@@ -61,9 +56,7 @@ func runPush(ctx context.Context, opts pushOptions, services []string) error {
 	}
 
 	_, err = progress.Run(ctx, func(ctx context.Context) (string, error) {
-		return "", c.ComposeService().Push(ctx, project, compose.PushOptions{
-			IgnoreFailures: opts.Ignorefailures,
-		})
+		return "", c.ComposeService().Push(ctx, project)
 	})
 	return err
 }
diff --git a/cli/cmd/compose/run.go b/cli/cmd/compose/run.go
index 8729316f..4eacd070 100644
--- a/cli/cmd/compose/run.go
+++ b/cli/cmd/compose/run.go
@@ -22,7 +22,6 @@ import (
 	"os"
 	"strings"
 
-	"github.com/compose-spec/compose-go/loader"
 	"github.com/compose-spec/compose-go/types"
 	"github.com/mattn/go-shellwords"
 	"github.com/spf13/cobra"
@@ -35,69 +34,18 @@ import (
 
 type runOptions struct {
 	*composeOptions
-	Service      string
-	Command      []string
-	environment  []string
-	Detach       bool
-	Remove       bool
-	noTty        bool
-	user         string
-	workdir      string
-	entrypoint   string
-	labels       []string
-	volumes      []string
-	publish      []string
-	useAliases   bool
-	servicePorts bool
-	name         string
-	noDeps       bool
-}
-
-func (opts runOptions) apply(project *types.Project) error {
-	target, err := project.GetService(opts.Service)
-	if err != nil {
-		return err
-	}
-	if !opts.servicePorts {
-		target.Ports = []types.ServicePortConfig{}
-	}
-	if len(opts.publish) > 0 {
-		target.Ports = []types.ServicePortConfig{}
-		for _, p := range opts.publish {
-			config, err := types.ParsePortConfig(p)
-			if err != nil {
-				return err
-			}
-			target.Ports = append(target.Ports, config...)
-		}
-	}
-	if len(opts.volumes) > 0 {
-		target.Volumes = []types.ServiceVolumeConfig{}
-		for _, v := range opts.volumes {
-			volume, err := loader.ParseVolume(v)
-			if err != nil {
-				return err
-			}
-			target.Volumes = append(target.Volumes, volume)
-		}
-	}
-
-	if opts.noDeps {
-		for _, s := range project.Services {
-			if s.Name != opts.Service {
-				project.DisabledServices = append(project.DisabledServices, s)
-			}
-		}
-		project.Services = types.Services{target}
-	}
-
-	for i, s := range project.Services {
-		if s.Name == opts.Service {
-			project.Services[i] = target
-			break
-		}
-	}
-	return nil
+	Service     string
+	Command     []string
+	environment []string
+	Detach      bool
+	Remove      bool
+	noTty       bool
+	user        string
+	workdir     string
+	entrypoint  string
+	labels      []string
+	name        string
+	noDeps      bool
 }
 
 func runCommand(p *projectOptions) *cobra.Command {
@@ -115,9 +63,6 @@ func runCommand(p *projectOptions) *cobra.Command {
 				opts.Command = args[1:]
 			}
 			opts.Service = args[0]
-			if len(opts.publish) > 0 && opts.servicePorts {
-				return fmt.Errorf("--service-ports and --publish are incompatible")
-			}
 			return runRun(cmd.Context(), opts)
 		},
 	}
@@ -132,10 +77,6 @@ func runCommand(p *projectOptions) *cobra.Command {
 	flags.StringVarP(&opts.workdir, "workdir", "w", "", "Working directory inside the container")
 	flags.StringVar(&opts.entrypoint, "entrypoint", "", "Override the entrypoint of the image")
 	flags.BoolVar(&opts.noDeps, "no-deps", false, "Don't start linked services.")
-	flags.StringArrayVarP(&opts.volumes, "volumes", "v", []string{}, "Bind mount a volume.")
-	flags.StringArrayVarP(&opts.publish, "publish", "p", []string{}, "Publish a container's port(s) to the host.")
-	flags.BoolVar(&opts.useAliases, "use-aliases", false, "Use the service's network useAliases in the network(s) the container connects to.")
-	flags.BoolVar(&opts.servicePorts, "service-ports", false, "Run command with the service's ports enabled and mapped to the host.")
 
 	flags.SetInterspersed(false)
 	return cmd
@@ -147,9 +88,17 @@ func runRun(ctx context.Context, opts runOptions) error {
 		return err
 	}
 
-	err = opts.apply(project)
-	if err != nil {
-		return err
+	if opts.noDeps {
+		enabled, err := project.GetService(opts.Service)
+		if err != nil {
+			return err
+		}
+		for _, s := range project.Services {
+			if s.Name != opts.Service {
+				project.DisabledServices = append(project.DisabledServices, s)
+			}
+		}
+		project.Services = types.Services{enabled}
 	}
 
 	_, err = progress.Run(ctx, func(ctx context.Context) (string, error) {
@@ -178,21 +127,20 @@ func runRun(ctx context.Context, opts runOptions) error {
 
 	// start container and attach to container streams
 	runOpts := compose.RunOptions{
-		Name:              opts.name,
-		Service:           opts.Service,
-		Command:           opts.Command,
-		Detach:            opts.Detach,
-		AutoRemove:        opts.Remove,
-		Writer:            os.Stdout,
-		Reader:            os.Stdin,
-		Tty:               !opts.noTty,
-		WorkingDir:        opts.workdir,
-		User:              opts.user,
-		Environment:       opts.environment,
-		Entrypoint:        entrypoint,
-		Labels:            labels,
-		UseNetworkAliases: opts.useAliases,
-		Index:             0,
+		Name:        opts.name,
+		Service:     opts.Service,
+		Command:     opts.Command,
+		Detach:      opts.Detach,
+		AutoRemove:  opts.Remove,
+		Writer:      os.Stdout,
+		Reader:      os.Stdin,
+		Tty:         !opts.noTty,
+		WorkingDir:  opts.workdir,
+		User:        opts.user,
+		Environment: opts.environment,
+		Entrypoint:  entrypoint,
+		Labels:      labels,
+		Index:       0,
 	}
 	exitCode, err := c.ComposeService().RunOneOffContainer(ctx, project, runOpts)
 	if exitCode != 0 {
diff --git a/cli/cmd/compose/top.go b/cli/cmd/compose/top.go
deleted file mode 100644
index c7d839cc..00000000
--- a/cli/cmd/compose/top.go
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package compose
-
-import (
-	"context"
-	"fmt"
-	"io"
-	"os"
-	"sort"
-	"strings"
-	"text/tabwriter"
-
-	"github.com/spf13/cobra"
-
-	"github.com/docker/compose-cli/api/client"
-)
-
-type topOptions struct {
-	*projectOptions
-}
-
-func topCommand(p *projectOptions) *cobra.Command {
-	opts := topOptions{
-		projectOptions: p,
-	}
-	topCmd := &cobra.Command{
-		Use:   "top",
-		Short: "Display the running processes",
-		RunE: func(cmd *cobra.Command, args []string) error {
-			return runTop(cmd.Context(), opts, args)
-		},
-	}
-	return topCmd
-}
-
-func runTop(ctx context.Context, opts topOptions, services []string) error {
-	c, err := client.NewWithDefaultLocalBackend(ctx)
-	if err != nil {
-		return err
-	}
-	projectName, err := opts.toProjectName()
-	if err != nil {
-		return err
-	}
-	containers, err := c.ComposeService().Top(ctx, projectName, services)
-	if err != nil {
-		return err
-	}
-
-	sort.Slice(containers, func(i, j int) bool {
-		return containers[i].Name < containers[j].Name
-	})
-
-	for _, container := range containers {
-		fmt.Printf("%s\n", container.Name)
-		err := psPrinter(os.Stdout, func(w io.Writer) {
-			for _, proc := range container.Processes {
-				info := []interface{}{}
-				for _, p := range proc {
-					info = append(info, p)
-				}
-				_, _ = fmt.Fprintf(w, strings.Repeat("%s\t", len(info))+"\n", info...)
-
-			}
-			fmt.Fprintln(w)
-		},
-			container.Titles...)
-		if err != nil {
-			return err
-		}
-	}
-	return nil
-}
-
-func psPrinter(out io.Writer, printer func(writer io.Writer), headers ...string) error {
-	w := tabwriter.NewWriter(out, 5, 1, 3, ' ', 0)
-	_, _ = fmt.Fprintln(w, strings.Join(headers, "\t"))
-	printer(w)
-	return w.Flush()
-}
diff --git a/cli/cmd/compose/up.go b/cli/cmd/compose/up.go
index aa731890..f9ac8e16 100644
--- a/cli/cmd/compose/up.go
+++ b/cli/cmd/compose/up.go
@@ -68,6 +68,7 @@ type upOptions struct {
 	timeout            int
 	noInherit          bool
 	attachDependencies bool
+	quietPull          bool
 }
 
 func (opts upOptions) recreateStrategy() string {
@@ -196,6 +197,7 @@ func upCommand(p *projectOptions, contextType string) *cobra.Command {
 		flags.BoolVar(&opts.recreateDeps, "always-recreate-deps", false, "Recreate dependent containers. Incompatible with --no-recreate.")
 		flags.BoolVarP(&opts.noInherit, "renew-anon-volumes", "V", false, "Recreate anonymous volumes instead of retrieving data from the previous containers.")
 		flags.BoolVar(&opts.attachDependencies, "attach-dependencies", false, "Attach to dependent containers.")
+		flags.BoolVar(&opts.quietPull, "quiet-pull", false, "Pull without printing progress information.")
 	}
 
 	return upCmd
@@ -214,7 +216,8 @@ func runUp(ctx context.Context, opts upOptions, services []string) error {
 
 	_, err = progress.Run(ctx, func(ctx context.Context) (string, error) {
 		return "", c.ComposeService().Up(ctx, project, compose.UpOptions{
-			Detach: opts.Detach,
+			Detach:    opts.Detach,
+			QuietPull: opts.quietPull,
 		})
 	})
 	return err
@@ -239,6 +242,7 @@ func runCreateStart(ctx context.Context, opts upOptions, services []string) erro
 			RecreateDependencies: opts.dependenciesRecreateStrategy(),
 			Inherit:              !opts.noInherit,
 			Timeout:              opts.GetTimeout(),
+			QuietPull:            opts.quietPull,
 		})
 		if err != nil {
 			return "", err
diff --git a/cli/cmd/context/context.go b/cli/cmd/context/context.go
index 53feffaa..7c73c9b9 100644
--- a/cli/cmd/context/context.go
+++ b/cli/cmd/context/context.go
@@ -17,7 +17,6 @@
 package context
 
 import (
-	"github.com/docker/compose-cli/cli/mobycli"
 	"github.com/spf13/cobra"
 )
 
@@ -36,32 +35,7 @@ func Command() *cobra.Command {
 		useCommand(),
 		inspectCommand(),
 		updateCommand(),
-		exportCommand(),
-		importCommand(),
 	)
 
 	return cmd
 }
-
-func exportCommand() *cobra.Command {
-	cmd := &cobra.Command{
-		Use:   "export",
-		Short: "Export a context to a tar or kubeconfig file",
-		Run: func(cmd *cobra.Command, args []string) {
-			mobycli.Exec(cmd.Root())
-		},
-	}
-	cmd.Flags().Bool("kubeconfig", false, "Export as a kubeconfig file")
-	return cmd
-}
-
-func importCommand() *cobra.Command {
-	cmd := &cobra.Command{
-		Use:   "import",
-		Short: "Import a context from a tar or zip file",
-		Run: func(cmd *cobra.Command, args []string) {
-			mobycli.Exec(cmd.Root())
-		},
-	}
-	return cmd
-}
diff --git a/cli/cmd/version.go b/cli/cmd/version.go
index 878d0b1e..89ea6477 100644
--- a/cli/cmd/version.go
+++ b/cli/cmd/version.go
@@ -36,12 +36,8 @@ func VersionCommand() *cobra.Command {
 		Use:   "version",
 		Short: "Show the Docker version information",
 		Args:  cobra.MaximumNArgs(0),
-		RunE: func(cmd *cobra.Command, _ []string) error {
-			err := runVersion(cmd)
-			if err != nil {
-				return ExitCodeError{ExitCode: 1}
-			}
-			return nil
+		Run: func(cmd *cobra.Command, _ []string) {
+			runVersion(cmd)
 		},
 	}
 	// define flags for backward compatibility with com.docker.cli
@@ -52,38 +48,34 @@ func VersionCommand() *cobra.Command {
 	return cmd
 }
 
-func runVersion(cmd *cobra.Command) error {
+func runVersion(cmd *cobra.Command) {
 	var versionString string
-	var err error
 	format := strings.ToLower(strings.ReplaceAll(cmd.Flag(formatOpt).Value.String(), " ", ""))
 	displayedVersion := strings.TrimPrefix(internal.Version, "v")
 	// Replace is preferred in this case to keep the order.
 	switch format {
 	case formatter.PRETTY, "":
-		versionString, err = getOutFromMoby(cmd, fixedPrettyArgs(os.Args[1:])...)
-		versionString = strings.Replace(versionString,
+		versionString = strings.Replace(getOutFromMoby(cmd, fixedPrettyArgs(os.Args[1:])...),
 			"\n Version:", "\n Cloud integration: "+displayedVersion+"\n Version:", 1)
 	case formatter.JSON, formatter.TemplateLegacyJSON: // Try to catch full JSON formats
-		versionString, err = getOutFromMoby(cmd, fixedJSONArgs(os.Args[1:])...)
-		versionString = strings.Replace(versionString,
+		versionString = strings.Replace(getOutFromMoby(cmd, fixedJSONArgs(os.Args[1:])...),
 			`"Version":`, fmt.Sprintf(`"CloudIntegration":%q,"Version":`, displayedVersion), 1)
 	default:
-		versionString, err = getOutFromMoby(cmd)
+		versionString = getOutFromMoby(cmd)
 	}
 
 	fmt.Print(versionString)
-	return err
 }
 
-func getOutFromMoby(cmd *cobra.Command, args ...string) (string, error) {
-	versionResult, err := mobycli.ExecSilent(cmd.Context(), args...)
+func getOutFromMoby(cmd *cobra.Command, args ...string) string {
+	versionResult, _ := mobycli.ExecSilent(cmd.Context(), args...)
 	// we don't want to fail on error, there is an error if the engine is not available but it displays client version info
 	// Still, technically the [] byte versionResult could be nil, just let the original command display what it has to display
 	if versionResult == nil {
 		mobycli.Exec(cmd.Root())
-		return "", nil
+		return ""
 	}
-	return string(versionResult), err
+	return string(versionResult)
 }
 
 func fixedPrettyArgs(oArgs []string) []string {
diff --git a/cli/formatter/colors.go b/cli/formatter/colors.go
index d5b2e816..cf19f9a2 100644
--- a/cli/formatter/colors.go
+++ b/cli/formatter/colors.go
@@ -18,10 +18,7 @@ package formatter
 
 import (
 	"fmt"
-	"os"
 	"strconv"
-
-	"github.com/mattn/go-isatty"
 )
 
 var names = []string{
@@ -35,36 +32,6 @@ var names = []string{
 	"white",
 }
 
-const (
-	// Never use ANSI codes
-	Never = "never"
-
-	// Always use ANSI codes
-	Always = "always"
-
-	// Auto detect terminal is a tty and can use ANSI codes
-	Auto = "auto"
-)
-
-// SetANSIMode configure formatter for colored output on ANSI-compliant console
-func SetANSIMode(ansi string) {
-	if !useAnsi(ansi) {
-		nextColor = func() colorFunc {
-			return monochrome
-		}
-	}
-}
-
-func useAnsi(ansi string) bool {
-	switch ansi {
-	case Always:
-		return true
-	case Auto:
-		return isatty.IsTerminal(os.Stdout.Fd())
-	}
-	return false
-}
-
 // colorFunc use ANSI codes to render colored text on console
 type colorFunc func(s string) string
 
@@ -86,12 +53,6 @@ func makeColorFunc(code string) colorFunc {
 	}
 }
 
-var nextColor func() colorFunc = rainbowColor
-
-func rainbowColor() colorFunc {
-	return <-loop
-}
-
 var loop = make(chan colorFunc)
 
 func init() {
diff --git a/cli/formatter/logs.go b/cli/formatter/logs.go
index b0d377f8..bc320954 100644
--- a/cli/formatter/logs.go
+++ b/cli/formatter/logs.go
@@ -45,7 +45,7 @@ func (l *logConsumer) Register(name string, id string) {
 func (l *logConsumer) register(name string, id string) *presenter {
 	cf := monochrome
 	if l.color {
-		cf = nextColor()
+		cf = <-loop
 	}
 	p := &presenter{
 		colors: cf,
diff --git a/cli/main.go b/cli/main.go
index 2500cf22..eb59c005 100644
--- a/cli/main.go
+++ b/cli/main.go
@@ -47,8 +47,6 @@ import (
 	"github.com/docker/compose-cli/cli/mobycli"
 	cliopts "github.com/docker/compose-cli/cli/options"
 
-	cliflags "github.com/docker/cli/cli/flags"
-
 	// Backend registrations
 	_ "github.com/docker/compose-cli/aci"
 	_ "github.com/docker/compose-cli/ecs"
@@ -153,7 +151,10 @@ func main() {
 	})
 
 	flags := root.Flags()
-	opts.InstallFlags(flags)
+	flags.StringVarP(&opts.LogLevel, "log-level", "l", "info", "Set the logging level (\"debug\"|\"info\"|\"warn\"|\"error\"|\"fatal\")")
+	flags.BoolVarP(&opts.Debug, "debug", "D", false, "Enable debug output in the logs")
+	flags.StringVarP(&opts.Host, "host", "H", "", "Daemon socket(s) to connect to")
+	opts.AddContextFlags(flags)
 	opts.AddConfigFlags(flags)
 	flags.BoolVarP(&opts.Version, "version", "v", false, "Print version information and quit")
 
@@ -183,19 +184,18 @@ func main() {
 	ctx, cancel := newSigContext()
 	defer cancel()
 
-	// --version should immediately be forwarded to the original cli
-	if opts.Version {
+	// --host and --version should immediately be forwarded to the original cli
+	if opts.Host != "" || opts.Version {
 		mobycli.Exec(root)
 	}
 
 	if opts.Config == "" {
 		fatal(errors.New("config path cannot be empty"))
 	}
-
 	configDir := opts.Config
 	ctx = config.WithDir(ctx, configDir)
 
-	currentContext := determineCurrentContext(opts.Context, configDir, opts.Hosts)
+	currentContext := determineCurrentContext(opts.Context, configDir)
 
 	s, err := store.New(configDir)
 	if err != nil {
@@ -213,21 +213,7 @@ func main() {
 		compose.Command(ctype),
 		volume.Command(ctype),
 	)
-	if ctype == store.DefaultContextType || ctype == store.LocalContextType {
-		cnxOptions := cliflags.CommonOptions{
-			Context:   opts.Context,
-			Debug:     opts.Debug,
-			Hosts:     opts.Hosts,
-			LogLevel:  opts.LogLevel,
-			TLS:       opts.TLS,
-			TLSVerify: opts.TLSVerify,
-		}
 
-		if opts.TLSVerify {
-			cnxOptions.TLSOptions = opts.TLSOptions
-		}
-		ctx = apicontext.WithCliOptions(ctx, cnxOptions)
-	}
 	ctx = apicontext.WithCurrentContext(ctx, currentContext)
 	ctx = store.WithContextStore(ctx, s)
 
@@ -316,31 +302,15 @@ func newSigContext() (context.Context, func()) {
 	return ctx, cancel
 }
 
-func determineCurrentContext(flag string, configDir string, hosts []string) string {
-	// host and context flags cannot be both set at the same time -- the local backend enforces this when resolving hostname
-	// -H flag disables context --> set default as current
-	if len(hosts) > 0 {
-		return "default"
-	}
-	// DOCKER_HOST disables context --> set default as current
-	if _, present := os.LookupEnv("DOCKER_HOST"); present {
-		return "default"
-	}
+func determineCurrentContext(flag string, configDir string) string {
 	res := flag
 	if res == "" {
-		// check if DOCKER_CONTEXT env variable was set
-		if _, present := os.LookupEnv("DOCKER_CONTEXT"); present {
-			res = os.Getenv("DOCKER_CONTEXT")
-		}
-
-		if res == "" {
-			config, err := config.LoadFile(configDir)
-			if err != nil {
-				fmt.Fprintln(os.Stderr, errors.Wrap(err, "WARNING"))
-				return "default"
-			}
-			res = config.CurrentContext
+		config, err := config.LoadFile(configDir)
+		if err != nil {
+			fmt.Fprintln(os.Stderr, errors.Wrap(err, "WARNING"))
+			return "default"
 		}
+		res = config.CurrentContext
 	}
 	if res == "" {
 		res = "default"
diff --git a/cli/options/options.go b/cli/options/options.go
index c65e62ae..764c9cb5 100644
--- a/cli/options/options.go
+++ b/cli/options/options.go
@@ -17,14 +17,16 @@
 package options
 
 import (
+	apicontext "github.com/docker/compose-cli/api/context"
 	cliconfig "github.com/docker/compose-cli/cli/config"
-
-	cliflags "github.com/docker/cli/cli/flags"
 )
 
 // GlobalOpts contains the global CLI options
 type GlobalOpts struct {
+	apicontext.ContextFlags
 	cliconfig.ConfigFlags
-	cliflags.CommonOptions
-	Version bool
+	Debug    bool
+	LogLevel string
+	Version  bool
+	Host     string
 }
diff --git a/docs/reference/compose.md b/docs/reference/compose.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_build.md b/docs/reference/compose_build.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_convert.md b/docs/reference/compose_convert.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_create.md b/docs/reference/compose_create.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_down.md b/docs/reference/compose_down.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_events.md b/docs/reference/compose_events.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_exec.md b/docs/reference/compose_exec.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_kill.md b/docs/reference/compose_kill.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_logs.md b/docs/reference/compose_logs.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_ls.md b/docs/reference/compose_ls.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_pause.md b/docs/reference/compose_pause.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_ps.md b/docs/reference/compose_ps.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_pull.md b/docs/reference/compose_pull.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_push.md b/docs/reference/compose_push.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_rm.md b/docs/reference/compose_rm.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_run.md b/docs/reference/compose_run.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_start.md b/docs/reference/compose_start.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_stop.md b/docs/reference/compose_stop.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_top.md b/docs/reference/compose_top.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_unpause.md b/docs/reference/compose_unpause.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/compose_up.md b/docs/reference/compose_up.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/docs/reference/docker_compose.yaml b/docs/reference/docker_compose.yaml
deleted file mode 100644
index 3008432e..00000000
--- a/docs/reference/docker_compose.yaml
+++ /dev/null
@@ -1,121 +0,0 @@
-command: docker compose
-short: Docker Compose
-long: Docker Compose
-pname: docker
-plink: docker.yaml
-cname:
-  - docker compose build
-  - docker compose convert
-  - docker compose create
-  - docker compose down
-  - docker compose events
-  - docker compose exec
-  - docker compose kill
-  - docker compose logs
-  - docker compose ls
-  - docker compose pause
-  - docker compose ps
-  - docker compose pull
-  - docker compose push
-  - docker compose rm
-  - docker compose run
-  - docker compose start
-  - docker compose stop
-  - docker compose top
-  - docker compose unpause
-  - docker compose up
-clink:
-  - docker_compose_build.yaml
-  - docker_compose_convert.yaml
-  - docker_compose_create.yaml
-  - docker_compose_down.yaml
-  - docker_compose_events.yaml
-  - docker_compose_exec.yaml
-  - docker_compose_kill.yaml
-  - docker_compose_logs.yaml
-  - docker_compose_ls.yaml
-  - docker_compose_pause.yaml
-  - docker_compose_ps.yaml
-  - docker_compose_pull.yaml
-  - docker_compose_push.yaml
-  - docker_compose_rm.yaml
-  - docker_compose_run.yaml
-  - docker_compose_start.yaml
-  - docker_compose_stop.yaml
-  - docker_compose_top.yaml
-  - docker_compose_unpause.yaml
-  - docker_compose_up.yaml
-options:
-  - option: ansi
-    value_type: string
-    default_value: auto
-    description: |
-        Control when to print ANSI control characters ("never"|"always"|"auto")
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: env-file
-    value_type: string
-    description: Specify an alternate environment file.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: file
-    shorthand: f
-    value_type: stringArray
-    default_value: '[]'
-    description: Compose configuration files
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: profile
-    value_type: stringArray
-    default_value: '[]'
-    description: Specify a profile to enable
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: project-directory
-    value_type: string
-    description: |-
-        Specify an alternate working directory
-        (default: the path of the Compose file)
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: project-name
-    shorthand: p
-    value_type: string
-    description: Project name
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: workdir
-    value_type: string
-    description: |-
-        DEPRECATED! USE --project-directory INSTEAD.
-        Specify an alternate working directory
-        (default: the path of the Compose file)
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_build.yaml b/docs/reference/docker_compose_build.yaml
deleted file mode 100644
index 1921bd31..00000000
--- a/docs/reference/docker_compose_build.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
-command: docker compose build
-short: Build or rebuild services
-long: Build or rebuild services
-usage: docker compose build [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: build-arg
-    value_type: stringArray
-    default_value: '[]'
-    description: Set build-time variables for services.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: progress
-    value_type: string
-    default_value: auto
-    description: Set type of progress output ("auto", "plain", "tty")
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: pull
-    value_type: bool
-    default_value: "false"
-    description: Always attempt to pull a newer version of the image.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: quiet
-    shorthand: q
-    value_type: bool
-    default_value: "false"
-    description: Don't print anything to STDOUT
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_convert.yaml b/docs/reference/docker_compose_convert.yaml
deleted file mode 100644
index de7c29b8..00000000
--- a/docs/reference/docker_compose_convert.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
-command: docker compose convert
-aliases: config
-short: Converts the compose file to platform's canonical format
-long: Converts the compose file to platform's canonical format
-usage: docker compose convert SERVICES
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: format
-    value_type: string
-    default_value: yaml
-    description: 'Format the output. Values: [yaml | json]'
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: quiet
-    shorthand: q
-    value_type: bool
-    default_value: "false"
-    description: Only validate the configuration, don't print anything.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: resolve-image-digests
-    value_type: bool
-    default_value: "false"
-    description: Pin image tags to digests.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_create.yaml b/docs/reference/docker_compose_create.yaml
deleted file mode 100644
index 7fd80b94..00000000
--- a/docs/reference/docker_compose_create.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-command: docker compose create
-short: Creates containers for a service.
-long: Creates containers for a service.
-usage: docker compose create [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: build
-    value_type: bool
-    default_value: "false"
-    description: Build images before starting containers.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: force-recreate
-    value_type: bool
-    default_value: "false"
-    description: |
-        Recreate containers even if their configuration and image haven't changed.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-build
-    value_type: bool
-    default_value: "false"
-    description: Don't build an image, even if it's missing.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-recreate
-    value_type: bool
-    default_value: "false"
-    description: |
-        If containers already exist, don't recreate them. Incompatible with --force-recreate.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_down.yaml b/docs/reference/docker_compose_down.yaml
deleted file mode 100644
index f0ebc6e6..00000000
--- a/docs/reference/docker_compose_down.yaml
+++ /dev/null
@@ -1,53 +0,0 @@
-command: docker compose down
-short: Stop and remove containers, networks
-long: Stop and remove containers, networks
-usage: docker compose down
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: remove-orphans
-    value_type: bool
-    default_value: "false"
-    description: |
-        Remove containers for services not defined in the Compose file.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: rmi
-    value_type: string
-    description: |
-        Remove images used by services. "local" remove only images that don't have a custom tag ("local"|"all")
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: timeout
-    shorthand: t
-    value_type: int
-    default_value: "10"
-    description: Specify a shutdown timeout in seconds
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: volumes
-    shorthand: v
-    value_type: bool
-    default_value: "false"
-    description: |4
-         Remove named volumes declared in the `volumes` section of the Compose file and anonymous volumes attached to containers.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_events.yaml b/docs/reference/docker_compose_events.yaml
deleted file mode 100644
index 128e78af..00000000
--- a/docs/reference/docker_compose_events.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-command: docker compose events
-short: Receive real time events from containers.
-long: Receive real time events from containers.
-usage: docker compose events [options] [--] [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: json
-    value_type: bool
-    default_value: "false"
-    description: Output events as a stream of json objects
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_exec.yaml b/docs/reference/docker_compose_exec.yaml
deleted file mode 100644
index ed7969df..00000000
--- a/docs/reference/docker_compose_exec.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
-command: docker compose exec
-short: Execute a command in a running container.
-long: Execute a command in a running container.
-usage: docker compose exec [options] [-e KEY=VAL...] [--] SERVICE COMMAND [ARGS...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: ""
-    shorthand: T
-    value_type: bool
-    default_value: "false"
-    description: |
-        Disable pseudo-tty allocation. By default `docker compose exec` allocates a TTY.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: detach
-    shorthand: d
-    value_type: bool
-    default_value: "false"
-    description: 'Detached mode: Run command in the background.'
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: env
-    shorthand: e
-    value_type: stringArray
-    default_value: '[]'
-    description: Set environment variables
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: index
-    value_type: int
-    default_value: "1"
-    description: |
-        index of the container if there are multiple instances of a service [default: 1].
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: privileged
-    value_type: bool
-    default_value: "false"
-    description: Give extended privileges to the process.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: user
-    shorthand: u
-    value_type: string
-    description: Run the command as this user.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: workdir
-    shorthand: w
-    value_type: string
-    description: Path to workdir directory for this command.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_kill.yaml b/docs/reference/docker_compose_kill.yaml
deleted file mode 100644
index 2312ea15..00000000
--- a/docs/reference/docker_compose_kill.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-command: docker compose kill
-short: Force stop service containers.
-long: Force stop service containers.
-usage: docker compose kill [options] [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: signal
-    shorthand: s
-    value_type: string
-    default_value: SIGKILL
-    description: SIGNAL to send to the container.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_logs.yaml b/docs/reference/docker_compose_logs.yaml
deleted file mode 100644
index 195eb916..00000000
--- a/docs/reference/docker_compose_logs.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-command: docker compose logs
-short: View output from containers
-long: View output from containers
-usage: docker compose logs [service...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: follow
-    shorthand: f
-    value_type: bool
-    default_value: "false"
-    description: Follow log output.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-color
-    value_type: bool
-    default_value: "false"
-    description: Produce monochrome output.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-log-prefix
-    value_type: bool
-    default_value: "false"
-    description: Don't print prefix in logs.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: timestamps
-    shorthand: t
-    value_type: bool
-    default_value: "false"
-    description: Show timestamps.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_ls.yaml b/docs/reference/docker_compose_ls.yaml
deleted file mode 100644
index ffb4c854..00000000
--- a/docs/reference/docker_compose_ls.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
-command: docker compose ls
-short: List running compose projects
-long: List running compose projects
-usage: docker compose ls
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: filter
-    value_type: filter
-    description: Filter output based on conditions provided.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: format
-    value_type: string
-    default_value: pretty
-    description: 'Format the output. Values: [pretty | json].'
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: quiet
-    shorthand: q
-    value_type: bool
-    default_value: "false"
-    description: Only display IDs.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_pause.yaml b/docs/reference/docker_compose_pause.yaml
deleted file mode 100644
index b44c6eef..00000000
--- a/docs/reference/docker_compose_pause.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-command: docker compose pause
-short: pause services
-long: pause services
-usage: docker compose pause [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_ps.yaml b/docs/reference/docker_compose_ps.yaml
deleted file mode 100644
index e0b8579c..00000000
--- a/docs/reference/docker_compose_ps.yaml
+++ /dev/null
@@ -1,52 +0,0 @@
-command: docker compose ps
-short: List containers
-long: List containers
-usage: docker compose ps
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: all
-    shorthand: a
-    value_type: bool
-    default_value: "false"
-    description: |
-        Show all stopped containers (including those created by the run command)
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: format
-    value_type: string
-    default_value: pretty
-    description: 'Format the output. Values: [pretty | json].'
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: quiet
-    shorthand: q
-    value_type: bool
-    default_value: "false"
-    description: Only display IDs
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: services
-    value_type: bool
-    default_value: "false"
-    description: Display services
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_pull.yaml b/docs/reference/docker_compose_pull.yaml
deleted file mode 100644
index 7960d3a2..00000000
--- a/docs/reference/docker_compose_pull.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-command: docker compose pull
-short: Pull service images
-long: Pull service images
-usage: docker compose pull [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: include-deps
-    value_type: bool
-    default_value: "false"
-    description: Also pull services declared as dependencies
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: quiet
-    shorthand: q
-    value_type: bool
-    default_value: "false"
-    description: Pull without printing progress information
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_push.yaml b/docs/reference/docker_compose_push.yaml
deleted file mode 100644
index 92a2068a..00000000
--- a/docs/reference/docker_compose_push.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-command: docker compose push
-short: Push service images
-long: Push service images
-usage: docker compose push [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: ignore-push-failures
-    value_type: bool
-    default_value: "false"
-    description: Push what it can and ignores images with push failures
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_rm.yaml b/docs/reference/docker_compose_rm.yaml
deleted file mode 100644
index 6e4a896f..00000000
--- a/docs/reference/docker_compose_rm.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-command: docker compose rm
-short: Removes stopped service containers
-long: Removes stopped service containers
-usage: docker compose rm [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: force
-    shorthand: f
-    value_type: bool
-    default_value: "false"
-    description: Don't ask to confirm removal
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: stop
-    shorthand: s
-    value_type: bool
-    default_value: "false"
-    description: Stop the containers, if required, before removing
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: volumes
-    shorthand: v
-    value_type: bool
-    default_value: "false"
-    description: Remove any anonymous volumes attached to containers
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_run.yaml b/docs/reference/docker_compose_run.yaml
deleted file mode 100644
index 471d0833..00000000
--- a/docs/reference/docker_compose_run.yaml
+++ /dev/null
@@ -1,147 +0,0 @@
-command: docker compose run
-short: Run a one-off command on a service.
-long: Run a one-off command on a service.
-usage: docker compose run [options] [-v VOLUME...] [-p PORT...] [-e KEY=VAL...] [-l
-    KEY=VALUE...] SERVICE [COMMAND] [ARGS...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: detach
-    shorthand: d
-    value_type: bool
-    default_value: "false"
-    description: Run container in background and print container ID
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: entrypoint
-    value_type: string
-    description: Override the entrypoint of the image
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: env
-    shorthand: e
-    value_type: stringArray
-    default_value: '[]'
-    description: Set environment variables
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: labels
-    shorthand: l
-    value_type: stringArray
-    default_value: '[]'
-    description: Add or override a label
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: name
-    value_type: string
-    description: ' Assign a name to the container'
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-TTY
-    shorthand: T
-    value_type: bool
-    default_value: "false"
-    description: |
-        Disable pseudo-tty allocation. By default docker compose run allocates a TTY
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-deps
-    value_type: bool
-    default_value: "false"
-    description: Don't start linked services.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: publish
-    shorthand: p
-    value_type: stringArray
-    default_value: '[]'
-    description: Publish a container's port(s) to the host.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: rm
-    value_type: bool
-    default_value: "false"
-    description: Automatically remove the container when it exits
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: service-ports
-    value_type: bool
-    default_value: "false"
-    description: |
-        Run command with the service's ports enabled and mapped to the host.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: use-aliases
-    value_type: bool
-    default_value: "false"
-    description: |
-        Use the service's network useAliases in the network(s) the container connects to.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: user
-    shorthand: u
-    value_type: string
-    description: Run as specified username or uid
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: volumes
-    shorthand: v
-    value_type: stringArray
-    default_value: '[]'
-    description: Bind mount a volume.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: workdir
-    shorthand: w
-    value_type: string
-    description: Working directory inside the container
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_start.yaml b/docs/reference/docker_compose_start.yaml
deleted file mode 100644
index eea61b7b..00000000
--- a/docs/reference/docker_compose_start.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-command: docker compose start
-short: Start services
-long: Start services
-usage: docker compose start [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_stop.yaml b/docs/reference/docker_compose_stop.yaml
deleted file mode 100644
index c47c78df..00000000
--- a/docs/reference/docker_compose_stop.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-command: docker compose stop
-short: Stop services
-long: Stop services
-usage: docker compose stop [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: timeout
-    shorthand: t
-    value_type: int
-    default_value: "10"
-    description: Specify a shutdown timeout in seconds
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_top.yaml b/docs/reference/docker_compose_top.yaml
deleted file mode 100644
index 95f49262..00000000
--- a/docs/reference/docker_compose_top.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-command: docker compose top
-short: Display the running processes
-long: Display the running processes
-usage: docker compose top
-pname: docker compose
-plink: docker_compose.yaml
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_unpause.yaml b/docs/reference/docker_compose_unpause.yaml
deleted file mode 100644
index 66cc0a66..00000000
--- a/docs/reference/docker_compose_unpause.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-command: docker compose unpause
-short: unpause services
-long: unpause services
-usage: docker compose unpause [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/reference/docker_compose_up.yaml b/docs/reference/docker_compose_up.yaml
deleted file mode 100644
index 99ebe051..00000000
--- a/docs/reference/docker_compose_up.yaml
+++ /dev/null
@@ -1,187 +0,0 @@
-command: docker compose up
-short: Create and start containers
-long: Create and start containers
-usage: docker compose up [SERVICE...]
-pname: docker compose
-plink: docker_compose.yaml
-options:
-  - option: abort-on-container-exit
-    value_type: bool
-    default_value: "false"
-    description: |
-        Stops all containers if any container was stopped. Incompatible with -d
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: always-recreate-deps
-    value_type: bool
-    default_value: "false"
-    description: |
-        Recreate dependent containers. Incompatible with --no-recreate.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: attach-dependencies
-    value_type: bool
-    default_value: "false"
-    description: Attach to dependent containers.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: build
-    value_type: bool
-    default_value: "false"
-    description: Build images before starting containers.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: detach
-    shorthand: d
-    value_type: bool
-    default_value: "false"
-    description: 'Detached mode: Run containers in the background'
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: environment
-    shorthand: e
-    value_type: stringArray
-    default_value: '[]'
-    description: Environment variables
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: exit-code-from
-    value_type: string
-    description: |
-        Return the exit code of the selected service container. Implies --abort-on-container-exit
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: force-recreate
-    value_type: bool
-    default_value: "false"
-    description: |
-        Recreate containers even if their configuration and image haven't changed.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-build
-    value_type: bool
-    default_value: "false"
-    description: Don't build an image, even if it's missing.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-color
-    value_type: bool
-    default_value: "false"
-    description: Produce monochrome output.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-deps
-    value_type: bool
-    default_value: "false"
-    description: Don't start linked services.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-log-prefix
-    value_type: bool
-    default_value: "false"
-    description: Don't print prefix in logs.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-recreate
-    value_type: bool
-    default_value: "false"
-    description: |
-        If containers already exist, don't recreate them. Incompatible with --force-recreate.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: no-start
-    value_type: bool
-    default_value: "false"
-    description: Don't start the services after creating them.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: remove-orphans
-    value_type: bool
-    default_value: "false"
-    description: |
-        Remove containers for services not defined in the Compose file.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: renew-anon-volumes
-    shorthand: V
-    value_type: bool
-    default_value: "false"
-    description: |
-        Recreate anonymous volumes instead of retrieving data from the previous containers.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: scale
-    value_type: stringArray
-    default_value: '[]'
-    description: |
-        Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-  - option: timeout
-    shorthand: t
-    value_type: int
-    default_value: "10"
-    description: |
-        Use this timeout in seconds for container shutdown when attached or when containers are already running.
-    deprecated: false
-    experimental: false
-    experimentalcli: false
-    kubernetes: false
-    swarm: false
-deprecated: false
-experimental: false
-experimentalcli: false
-kubernetes: false
-swarm: false
-
diff --git a/docs/yaml/main/generate.go b/docs/yaml/main/generate.go
deleted file mode 100644
index 63792115..00000000
--- a/docs/yaml/main/generate.go
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package main
-
-import (
-	"fmt"
-	"io/ioutil"
-	"log"
-	"os"
-	"path/filepath"
-	"strings"
-
-	"github.com/spf13/cobra"
-	"github.com/spf13/pflag"
-
-	"github.com/docker/compose-cli/cli/cmd/compose"
-	. "github.com/docker/compose-cli/docs/yaml"
-)
-
-const descriptionSourcePath = "docs/reference/"
-
-func generateCliYaml(opts *options) error {
-	cmd := &cobra.Command{Use: "docker"}
-	cmd.AddCommand(compose.Command("local"))
-	disableFlagsInUseLine(cmd)
-	source := filepath.Join(opts.source, descriptionSourcePath)
-	if err := loadLongDescription(cmd, source); err != nil {
-		return err
-	}
-
-	cmd.DisableAutoGenTag = true
-	return GenYamlTree(cmd, opts.target)
-}
-
-func disableFlagsInUseLine(cmd *cobra.Command) {
-	visitAll(cmd, func(ccmd *cobra.Command) {
-		// do not add a `[flags]` to the end of the usage line.
-		ccmd.DisableFlagsInUseLine = true
-	})
-}
-
-// visitAll will traverse all commands from the root.
-// This is different from the VisitAll of cobra.Command where only parents
-// are checked.
-func visitAll(root *cobra.Command, fn func(*cobra.Command)) {
-	for _, cmd := range root.Commands() {
-		visitAll(cmd, fn)
-	}
-	fn(root)
-}
-
-func loadLongDescription(cmd *cobra.Command, path ...string) error {
-	for _, cmd := range cmd.Commands() {
-		if cmd.Name() == "" {
-			continue
-		}
-		fullpath := filepath.Join(path[0], strings.Join(append(path[1:], cmd.Name()), "_")+".md")
-
-		if cmd.HasSubCommands() {
-			if err := loadLongDescription(cmd, path[0], cmd.Name()); err != nil {
-				return err
-			}
-		}
-
-		if _, err := os.Stat(fullpath); err != nil {
-			log.Printf("WARN: %s does not exist, skipping\n", fullpath)
-			continue
-		}
-
-		content, err := ioutil.ReadFile(fullpath)
-		if err != nil {
-			return err
-		}
-		description, examples := ParseMDContent(string(content))
-		cmd.Long = description
-		cmd.Example = examples
-	}
-	return nil
-}
-
-type options struct {
-	source string
-	target string
-}
-
-func parseArgs() (*options, error) {
-	opts := &options{}
-	cwd, _ := os.Getwd()
-	flags := pflag.NewFlagSet(os.Args[0], pflag.ContinueOnError)
-	flags.StringVar(&opts.source, "root", cwd, "Path to project root")
-	flags.StringVar(&opts.target, "target", filepath.Join(cwd, "docs", "reference"), "Target path for generated yaml files")
-	err := flags.Parse(os.Args[1:])
-	return opts, err
-}
-
-func main() {
-	opts, err := parseArgs()
-	if err != nil {
-		fmt.Fprintln(os.Stderr, err.Error())
-	}
-	fmt.Printf("Project root: %s\n", opts.source)
-	fmt.Printf("Generating yaml files into %s\n", opts.target)
-	if err := generateCliYaml(opts); err != nil {
-		fmt.Fprintf(os.Stderr, "Failed to generate yaml files: %s\n", err.Error())
-	}
-}
diff --git a/docs/yaml/yaml.go b/docs/yaml/yaml.go
deleted file mode 100644
index 5f7559cb..00000000
--- a/docs/yaml/yaml.go
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package yaml
-
-import (
-	"fmt"
-	"io"
-	"os"
-	"path/filepath"
-	"sort"
-	"strings"
-
-	"github.com/spf13/cobra"
-	"github.com/spf13/pflag"
-	yaml "gopkg.in/yaml.v3"
-)
-
-type cmdOption struct {
-	Option          string
-	Shorthand       string `yaml:",omitempty"`
-	ValueType       string `yaml:"value_type,omitempty"`
-	DefaultValue    string `yaml:"default_value,omitempty"`
-	Description     string `yaml:",omitempty"`
-	Deprecated      bool
-	MinAPIVersion   string `yaml:"min_api_version,omitempty"`
-	Experimental    bool
-	ExperimentalCLI bool
-	Kubernetes      bool
-	Swarm           bool
-	OSType          string `yaml:"os_type,omitempty"`
-}
-
-type cmdDoc struct {
-	Name             string      `yaml:"command"`
-	SeeAlso          []string    `yaml:"parent,omitempty"`
-	Version          string      `yaml:"engine_version,omitempty"`
-	Aliases          string      `yaml:",omitempty"`
-	Short            string      `yaml:",omitempty"`
-	Long             string      `yaml:",omitempty"`
-	Usage            string      `yaml:",omitempty"`
-	Pname            string      `yaml:",omitempty"`
-	Plink            string      `yaml:",omitempty"`
-	Cname            []string    `yaml:",omitempty"`
-	Clink            []string    `yaml:",omitempty"`
-	Options          []cmdOption `yaml:",omitempty"`
-	InheritedOptions []cmdOption `yaml:"inherited_options,omitempty"`
-	Example          string      `yaml:"examples,omitempty"`
-	Deprecated       bool
-	MinAPIVersion    string `yaml:"min_api_version,omitempty"`
-	Experimental     bool
-	ExperimentalCLI  bool
-	Kubernetes       bool
-	Swarm            bool
-	OSType           string `yaml:"os_type,omitempty"`
-}
-
-// GenYamlTree creates yaml structured ref files
-func GenYamlTree(cmd *cobra.Command, dir string) error {
-	emptyStr := func(s string) string { return "" }
-	return GenYamlTreeCustom(cmd, dir, emptyStr)
-}
-
-// GenYamlTreeCustom creates yaml structured ref files
-func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string) error {
-	for _, c := range cmd.Commands() {
-		if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() {
-			continue
-		}
-		if err := GenYamlTreeCustom(c, dir, filePrepender); err != nil {
-			return err
-		}
-	}
-	if !cmd.HasParent() {
-		return nil
-	}
-
-	basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".yaml"
-	filename := filepath.Join(dir, basename)
-	f, err := os.Create(filename)
-	if err != nil {
-		return err
-	}
-	defer f.Close() //nolint: errcheck
-
-	if _, err := io.WriteString(f, filePrepender(filename)); err != nil {
-		return err
-	}
-	return GenYamlCustom(cmd, f)
-}
-
-// GenYamlCustom creates custom yaml output
-// nolint: gocyclo
-func GenYamlCustom(cmd *cobra.Command, w io.Writer) error {
-	cliDoc := cmdDoc{}
-	cliDoc.Name = cmd.CommandPath()
-
-	cliDoc.Aliases = strings.Join(cmd.Aliases, ", ")
-	cliDoc.Short = cmd.Short
-	cliDoc.Long = cmd.Long
-	if len(cliDoc.Long) == 0 {
-		cliDoc.Long = cliDoc.Short
-	}
-
-	if cmd.Runnable() {
-		cliDoc.Usage = cmd.UseLine()
-	}
-
-	if len(cmd.Example) > 0 {
-		cliDoc.Example = cmd.Example
-	}
-	if len(cmd.Deprecated) > 0 {
-		cliDoc.Deprecated = true
-	}
-	// Check recursively so that, e.g., `docker stack ls` returns the same output as `docker stack`
-	for curr := cmd; curr != nil; curr = curr.Parent() {
-		if v, ok := curr.Annotations["version"]; ok && cliDoc.MinAPIVersion == "" {
-			cliDoc.MinAPIVersion = v
-		}
-		if _, ok := curr.Annotations["experimental"]; ok && !cliDoc.Experimental {
-			cliDoc.Experimental = true
-		}
-		if _, ok := curr.Annotations["experimentalCLI"]; ok && !cliDoc.ExperimentalCLI {
-			cliDoc.ExperimentalCLI = true
-		}
-		if _, ok := curr.Annotations["kubernetes"]; ok && !cliDoc.Kubernetes {
-			cliDoc.Kubernetes = true
-		}
-		if _, ok := curr.Annotations["swarm"]; ok && !cliDoc.Swarm {
-			cliDoc.Swarm = true
-		}
-		if os, ok := curr.Annotations["ostype"]; ok && cliDoc.OSType == "" {
-			cliDoc.OSType = os
-		}
-	}
-
-	flags := cmd.NonInheritedFlags()
-	if flags.HasFlags() {
-		cliDoc.Options = genFlagResult(flags)
-	}
-	flags = cmd.InheritedFlags()
-	if flags.HasFlags() {
-		cliDoc.InheritedOptions = genFlagResult(flags)
-	}
-
-	if hasSeeAlso(cmd) {
-		if cmd.HasParent() {
-			parent := cmd.Parent()
-			cliDoc.Pname = parent.CommandPath()
-			link := cliDoc.Pname + ".yaml"
-			cliDoc.Plink = strings.Replace(link, " ", "_", -1)
-			cmd.VisitParents(func(c *cobra.Command) {
-				if c.DisableAutoGenTag {
-					cmd.DisableAutoGenTag = c.DisableAutoGenTag
-				}
-			})
-		}
-
-		children := cmd.Commands()
-		sort.Sort(byName(children))
-
-		for _, child := range children {
-			if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() {
-				continue
-			}
-			currentChild := cliDoc.Name + " " + child.Name()
-			cliDoc.Cname = append(cliDoc.Cname, cliDoc.Name+" "+child.Name())
-			link := currentChild + ".yaml"
-			cliDoc.Clink = append(cliDoc.Clink, strings.Replace(link, " ", "_", -1))
-		}
-	}
-
-	final, err := yaml.Marshal(&cliDoc)
-	if err != nil {
-		fmt.Println(err)
-		os.Exit(1)
-	}
-	if _, err := fmt.Fprintln(w, string(final)); err != nil {
-		return err
-	}
-	return nil
-}
-
-func genFlagResult(flags *pflag.FlagSet) []cmdOption {
-	var (
-		result []cmdOption
-		opt    cmdOption
-	)
-
-	flags.VisitAll(func(flag *pflag.Flag) {
-		opt = cmdOption{
-			Option:       flag.Name,
-			ValueType:    flag.Value.Type(),
-			DefaultValue: forceMultiLine(flag.DefValue),
-			Description:  forceMultiLine(flag.Usage),
-			Deprecated:   len(flag.Deprecated) > 0,
-		}
-
-		// Todo, when we mark a shorthand is deprecated, but specify an empty message.
-		// The flag.ShorthandDeprecated is empty as the shorthand is deprecated.
-		// Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok.
-		if !(len(flag.ShorthandDeprecated) > 0) && len(flag.Shorthand) > 0 {
-			opt.Shorthand = flag.Shorthand
-		}
-		if _, ok := flag.Annotations["experimental"]; ok {
-			opt.Experimental = true
-		}
-		if v, ok := flag.Annotations["version"]; ok {
-			opt.MinAPIVersion = v[0]
-		}
-		if _, ok := flag.Annotations["experimentalCLI"]; ok {
-			opt.ExperimentalCLI = true
-		}
-		if _, ok := flag.Annotations["kubernetes"]; ok {
-			opt.Kubernetes = true
-		}
-		if _, ok := flag.Annotations["swarm"]; ok {
-			opt.Swarm = true
-		}
-
-		// Note that the annotation can have multiple ostypes set, however, multiple
-		// values are currently not used (and unlikely will).
-		//
-		// To simplify usage of the os_type property in the YAML, and for consistency
-		// with the same property for commands, we're only using the first ostype that's set.
-		if ostypes, ok := flag.Annotations["ostype"]; ok && len(opt.OSType) == 0 && len(ostypes) > 0 {
-			opt.OSType = ostypes[0]
-		}
-
-		result = append(result, opt)
-	})
-
-	return result
-}
-
-// Temporary workaround for yaml lib generating incorrect yaml with long strings
-// that do not contain \n.
-func forceMultiLine(s string) string {
-	if len(s) > 60 && !strings.Contains(s, "\n") {
-		s = s + "\n"
-	}
-	return s
-}
-
-// Small duplication for cobra utils
-func hasSeeAlso(cmd *cobra.Command) bool {
-	if cmd.HasParent() {
-		return true
-	}
-	for _, c := range cmd.Commands() {
-		if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() {
-			continue
-		}
-		return true
-	}
-	return false
-}
-
-// ParseMDContent parse markdown file looking for Description and Examples sections
-func ParseMDContent(mdString string) (description string, examples string) {
-	parsedContent := strings.Split(mdString, "\n## ")
-	for _, s := range parsedContent {
-		if strings.Index(s, "Description") == 0 {
-			description = strings.TrimSpace(strings.TrimPrefix(s, "Description"))
-		}
-		if strings.Index(s, "Examples") == 0 {
-			examples = strings.TrimSpace(strings.TrimPrefix(s, "Examples"))
-		}
-	}
-	return description, examples
-}
-
-type byName []*cobra.Command
-
-func (s byName) Len() int           { return len(s) }
-func (s byName) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
-func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }
diff --git a/ecs/local/compose.go b/ecs/local/compose.go
index 69958af9..f8a8da8e 100644
--- a/ecs/local/compose.go
+++ b/ecs/local/compose.go
@@ -36,8 +36,8 @@ func (e ecsLocalSimulation) Build(ctx context.Context, project *types.Project, o
 	return e.compose.Build(ctx, project, options)
 }
 
-func (e ecsLocalSimulation) Push(ctx context.Context, project *types.Project, options compose.PushOptions) error {
-	return e.compose.Push(ctx, project, options)
+func (e ecsLocalSimulation) Push(ctx context.Context, project *types.Project) error {
+	return e.compose.Push(ctx, project)
 }
 
 func (e ecsLocalSimulation) Pull(ctx context.Context, project *types.Project) error {
@@ -191,11 +191,3 @@ func (e ecsLocalSimulation) Pause(ctx context.Context, project *types.Project) e
 func (e ecsLocalSimulation) UnPause(ctx context.Context, project *types.Project) error {
 	return e.compose.UnPause(ctx, project)
 }
-
-func (e ecsLocalSimulation) Top(ctx context.Context, projectName string, services []string) ([]compose.ContainerProcSummary, error) {
-	return e.compose.Top(ctx, projectName, services)
-}
-
-func (e ecsLocalSimulation) Events(ctx context.Context, project string, options compose.EventsOptions) error {
-	return e.compose.Events(ctx, project, options)
-}
diff --git a/ecs/top.go b/ecs/top.go
deleted file mode 100644
index 569a7c65..00000000
--- a/ecs/top.go
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package ecs
-
-import (
-	"context"
-
-	"github.com/docker/compose-cli/api/compose"
-	"github.com/docker/compose-cli/api/errdefs"
-)
-
-func (b *ecsAPIService) Top(ctx context.Context, projectName string, services []string) ([]compose.ContainerProcSummary, error) {
-	return nil, errdefs.ErrNotImplemented
-}
diff --git a/ecs/up.go b/ecs/up.go
index aa937f51..b899bd0d 100644
--- a/ecs/up.go
+++ b/ecs/up.go
@@ -35,7 +35,7 @@ func (b *ecsAPIService) Build(ctx context.Context, project *types.Project, optio
 	return errdefs.ErrNotImplemented
 }
 
-func (b *ecsAPIService) Push(ctx context.Context, project *types.Project, options compose.PushOptions) error {
+func (b *ecsAPIService) Push(ctx context.Context, project *types.Project) error {
 	return errdefs.ErrNotImplemented
 }
 
@@ -63,10 +63,6 @@ func (b *ecsAPIService) UnPause(ctx context.Context, project *types.Project) err
 	return errdefs.ErrNotImplemented
 }
 
-func (b *ecsAPIService) Events(ctx context.Context, project string, options compose.EventsOptions) error {
-	return errdefs.ErrNotImplemented
-}
-
 func (b *ecsAPIService) Up(ctx context.Context, project *types.Project, options compose.UpOptions) error {
 	logrus.Debugf("deploying on AWS with region=%q", b.Region)
 	err := b.aws.CheckRequirements(ctx, b.Region)
diff --git a/go.mod b/go.mod
index 0de5bcf3..d56ff170 100644
--- a/go.mod
+++ b/go.mod
@@ -17,13 +17,13 @@ require (
 	github.com/awslabs/goformation/v4 v4.15.6
 	github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129
 	github.com/cnabio/cnab-to-oci v0.3.1-beta1
-	github.com/compose-spec/compose-go v0.0.0-20210305065119-876e630c5382
+	github.com/compose-spec/compose-go v0.0.0-20210302161709-a66de601f6e2
 	github.com/containerd/console v1.0.1
 	github.com/containerd/containerd v1.4.3
 	github.com/containerd/continuity v0.0.0-20200928162600-f2cc35102c2a // indirect
 	github.com/distribution/distribution/v3 v3.0.0-20210209042832-22c074842eaa
-	github.com/docker/buildx v0.5.1
-	github.com/docker/cli v20.10.1+incompatible
+	github.com/docker/buildx v0.5.2-0.20210309210748-c9f02c32d495
+	github.com/docker/cli v20.10.3-0.20210127070556-d26bdfd4ea23+incompatible
 	github.com/docker/docker v20.10.1+incompatible
 	github.com/docker/go-connections v0.4.0
 	github.com/docker/go-units v0.4.0
@@ -39,7 +39,6 @@ require (
 	github.com/joho/godotenv v1.3.0
 	github.com/labstack/echo v3.3.10+incompatible
 	github.com/labstack/gommon v0.3.0 // indirect
-	github.com/mattn/go-isatty v0.0.12
 	github.com/mattn/go-shellwords v1.0.11
 	github.com/moby/buildkit v0.8.1-0.20201205083753-0af7b1b9c693
 	github.com/moby/term v0.0.0-20201110203204-bea5bbe245bf
diff --git a/go.sum b/go.sum
index 070d7126..f938f6c0 100644
--- a/go.sum
+++ b/go.sum
@@ -205,6 +205,7 @@ github.com/apex/log v1.3.0/go.mod h1:jd8Vpsr46WAe3EZSQ/IUMs2qQD/GOycT5rPWCO1yGcs
 github.com/apex/logs v0.0.4/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo=
 github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE=
 github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys=
+github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc=
 github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
 github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
 github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
@@ -249,6 +250,7 @@ github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAw
 github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
 github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
 github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
+github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
 github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
 github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U=
 github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg=
@@ -305,8 +307,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
 github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
 github.com/codahale/hdrhistogram v0.0.0-20160425231609-f8ad88b59a58/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
 github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
-github.com/compose-spec/compose-go v0.0.0-20210305065119-876e630c5382 h1:uKdXQudOB+DsiwDoyUR3in3uPWBk2DMxN36KlHYPjTY=
-github.com/compose-spec/compose-go v0.0.0-20210305065119-876e630c5382/go.mod h1:iz28nqFmtFuYQxfzPb7zEceImHoVrWoumcBPQutHnQ8=
+github.com/compose-spec/compose-go v0.0.0-20210302161709-a66de601f6e2 h1:gQHeYKe3H5IvvLeWsWjOlCxpo0DV6uGdCt4Q3Gr3fTg=
+github.com/compose-spec/compose-go v0.0.0-20210302161709-a66de601f6e2/go.mod h1:flNthwF3kg+JioxATZWSsuuA2N3zGGwggDNNGoE9PHA=
 github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
 github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM=
 github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340 h1:9atoWyI9RtXFwf7UDbme/6M8Ud0rFrx+Q3ZWgSnsxtw=
@@ -374,6 +376,7 @@ github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ
 github.com/cyphar/filepath-securejoin v0.2.2 h1:jCwT2GTP+PY5nBz3c/YL5PAIbusElVrPujOBSCj8xRg=
 github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
 github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E=
+github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg=
 github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -394,14 +397,14 @@ github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQ
 github.com/distribution/distribution/v3 v3.0.0-20210209042832-22c074842eaa h1:4D67sY0UhDO+F1EKq4dXzQhlRSK4/ZSoNnNvaDMyzBc=
 github.com/distribution/distribution/v3 v3.0.0-20210209042832-22c074842eaa/go.mod h1:qW81H7oTHBUYY65QKDwObaF1CQJoc7Je0uc+n4Ar4OM=
 github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
-github.com/docker/buildx v0.5.1 h1:lkMHQPKHyUUDbO2QO2JE9LLi8mlOULpzSoV7B/2XKso=
-github.com/docker/buildx v0.5.1/go.mod h1:YlxswdEKSMrxCCSYWU2p/Ii1oOOwu8lT3tJzJDpP7J4=
+github.com/docker/buildx v0.5.2-0.20210309210748-c9f02c32d495 h1:bAIxNmEhw5aMebRNw8yxr2z3g0m7jArgbt0F6sOPXD4=
+github.com/docker/buildx v0.5.2-0.20210309210748-c9f02c32d495/go.mod h1:WadVNX2QxutvzYgtwu3jpYd0D/SKwQOrAipyrPHOEi8=
 github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
 github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
 github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
 github.com/docker/cli v20.10.0-beta1.0.20201029214301-1d20b15adc38+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
-github.com/docker/cli v20.10.1+incompatible h1:7wfpCo1keo9xXmH6fFu29m0BCK0+Uzu4oIopGUS09bM=
-github.com/docker/cli v20.10.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
+github.com/docker/cli v20.10.3-0.20210127070556-d26bdfd4ea23+incompatible h1:rPkhMVkyVcQgvyfDh/bHJ+pJCeG6YjKbEhv0AFsu9NM=
+github.com/docker/cli v20.10.3-0.20210127070556-d26bdfd4ea23+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
 github.com/docker/compose-on-kubernetes v0.4.19-0.20190128150448-356b2919c496/go.mod h1:iT2pYfi580XlpaV4KmK0T6+4/9+XoKmk/fhoDod1emE=
 github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
 github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY=
@@ -420,8 +423,9 @@ github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompati
 github.com/docker/docker v20.10.0-beta1.0.20201110211921-af34b94a78a1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 github.com/docker/docker v20.10.1+incompatible h1:u0HIBLwOJdemyBdTCkoBX34u3lb5KyBo0rQE3a5Yg+E=
 github.com/docker/docker v20.10.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
-github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ=
 github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y=
+github.com/docker/docker-credential-helpers v0.6.4-0.20210125172408-38bea2ce277a h1:1DndKi+f9qs3AexOfI6di7RkWcWlNHzdqHu1cX19/ac=
+github.com/docker/docker-credential-helpers v0.6.4-0.20210125172408-38bea2ce277a/go.mod h1:ofX3UI0Gz1TteYBjtgs07O36Pyasyp66D2uKT7H8W1c=
 github.com/docker/go v1.5.1-1/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q=
 github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
 github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q=
@@ -617,8 +621,9 @@ github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQq
 github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
 github.com/gofrs/flock v0.8.0 h1:MSdYClljsF3PbENUUEx85nkWfJSGfzYI9yEBZOJz6CY=
 github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
-github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
 github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
+github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=
+github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
 github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
 github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
 github.com/gogo/googleapis v1.3.0/go.mod h1:d+q1s/xVJxZGKWwC/6UfPIF33J+G1Tq4GYv9Y+Tg/EU=
@@ -802,6 +807,7 @@ github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FK
 github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
 github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
 github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
+github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840/go.mod h1:Abjk0jbRkDaNCzsRhOv2iDCofYpX1eVsjozoiK63qLA=
 github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
 github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
 github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
@@ -827,7 +833,7 @@ github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8
 github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
 github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
-github.com/hashicorp/hcl/v2 v2.6.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY=
+github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY=
 github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
 github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
 github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
@@ -845,9 +851,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
 github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
 github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
 github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA=
 github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
-github.com/imdario/mergo v0.3.12-0.20210303221052-29fb3d3bdc55 h1:Z+928KmcMGWCKohke8GwDHOGQSlFQi2dg3uUbD5WDJA=
-github.com/imdario/mergo v0.3.12-0.20210303221052-29fb3d3bdc55/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
 github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
@@ -1383,6 +1388,8 @@ github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv
 github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
 github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU=
 github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
+github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
+github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
 github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU=
 github.com/weppos/publicsuffix-go v0.4.0/go.mod h1:z3LCPQ38eedDQSwmsSRW4Y7t2L8Ln16JPQ02lHAdn5k=
 github.com/weppos/publicsuffix-go v0.5.0 h1:rutRtjBJViU/YjcI5d80t4JAVvDltS6bciJg2K1HrLU=
@@ -1417,6 +1424,7 @@ github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1
 github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg=
 github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
 github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ=
+github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o=
 github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
 github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
 github.com/zmap/rc2 v0.0.0-20131011165748-24b9757f5521/go.mod h1:3YZ9o3WnatTIZhuOtot4IcUfzoKVjUHqu6WALIyI0nE=
@@ -1482,6 +1490,7 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh
 golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20200422194213-44a606286825/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o=
@@ -1677,8 +1686,9 @@ golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY=
 golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
diff --git a/kube/compose.go b/kube/compose.go
index 17dbfa3f..08a30851 100644
--- a/kube/compose.go
+++ b/kube/compose.go
@@ -169,7 +169,7 @@ func (s *composeService) Build(ctx context.Context, project *types.Project, opti
 }
 
 // Push executes the equivalent ot a `compose push`
-func (s *composeService) Push(ctx context.Context, project *types.Project, options compose.PushOptions) error {
+func (s *composeService) Push(ctx context.Context, project *types.Project) error {
 	return errdefs.ErrNotImplemented
 }
 
@@ -254,11 +254,3 @@ func (s *composeService) Pause(ctx context.Context, project *types.Project) erro
 func (s *composeService) UnPause(ctx context.Context, project *types.Project) error {
 	return errdefs.ErrNotImplemented
 }
-
-func (s *composeService) Top(ctx context.Context, projectName string, services []string) ([]compose.ContainerProcSummary, error) {
-	return nil, errdefs.ErrNotImplemented
-}
-
-func (s *composeService) Events(ctx context.Context, project string, options compose.EventsOptions) error {
-	return errdefs.ErrNotImplemented
-}
diff --git a/local/backend.go b/local/backend.go
index fa79f1eb..0e5ea277 100644
--- a/local/backend.go
+++ b/local/backend.go
@@ -19,20 +19,16 @@ package local
 import (
 	"context"
 
-	"github.com/docker/cli/cli/command"
+	"github.com/docker/docker/client"
+
 	"github.com/docker/compose-cli/api/backend"
 	"github.com/docker/compose-cli/api/cloud"
-
 	"github.com/docker/compose-cli/api/compose"
-	apiconfig "github.com/docker/compose-cli/api/config"
 	"github.com/docker/compose-cli/api/containers"
-	apicontext "github.com/docker/compose-cli/api/context"
 	"github.com/docker/compose-cli/api/resources"
 	"github.com/docker/compose-cli/api/secrets"
 	"github.com/docker/compose-cli/api/volumes"
 	local_compose "github.com/docker/compose-cli/local/compose"
-
-	cliconfig "github.com/docker/cli/cli/config"
 )
 
 type local struct {
@@ -46,13 +42,7 @@ func init() {
 }
 
 func service(ctx context.Context) (backend.Service, error) {
-	options := apicontext.CliOptions(ctx)
-	config := apiconfig.Dir(ctx)
-	configFile, err := cliconfig.Load(config)
-	if err != nil {
-		return nil, err
-	}
-	apiClient, err := command.NewAPIClientFromFlags(&options, configFile)
+	apiClient, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
 	if err != nil {
 		return nil, err
 	}
diff --git a/local/compose/attach.go b/local/compose/attach.go
index 95e3f0a1..7ebfa51c 100644
--- a/local/compose/attach.go
+++ b/local/compose/attach.go
@@ -31,7 +31,7 @@ import (
 	"github.com/docker/docker/pkg/stdcopy"
 )
 
-func (s *composeService) attach(ctx context.Context, project *types.Project, listener compose.ContainerEventListener, selectedServices []string) (Containers, error) {
+func (s *composeService) attach(ctx context.Context, project *types.Project, consumer compose.ContainerEventListener, selectedServices []string) (Containers, error) {
 	containers, err := s.getContainers(ctx, project, oneOffExclude, selectedServices)
 	if err != nil {
 		return nil, err
@@ -47,72 +47,33 @@ func (s *composeService) attach(ctx context.Context, project *types.Project, lis
 	fmt.Printf("Attaching to %s\n", strings.Join(names, ", "))
 
 	for _, container := range containers {
-		err := s.attachContainer(ctx, container, listener, project)
+		consumer(compose.ContainerEvent{
+			Type:    compose.ContainerEventAttach,
+			Source:  container.ID,
+			Name:    getContainerNameWithoutProject(container),
+			Service: container.Labels[serviceLabel],
+		})
+		err := s.attachContainer(ctx, container, consumer, project)
 		if err != nil {
 			return nil, err
 		}
 	}
-
-	// Watch events to capture container restart and re-attach
-	go func() {
-		crashed := map[string]struct{}{}
-		s.Events(ctx, project.Name, compose.EventsOptions{ // nolint: errcheck
-			Services: selectedServices,
-			Consumer: func(event compose.Event) error {
-				if event.Status == "die" {
-					crashed[event.Container] = struct{}{}
-					return nil
-				}
-				if _, ok := crashed[event.Container]; ok {
-					inspect, err := s.apiClient.ContainerInspect(ctx, event.Container)
-					if err != nil {
-						return err
-					}
-
-					container := moby.Container{
-						ID:    event.Container,
-						Names: []string{inspect.Name},
-						State: convert.ContainerRunning,
-						Labels: map[string]string{
-							projectLabel: project.Name,
-							serviceLabel: event.Service,
-						},
-					}
-
-					// Just ignore errors when reattaching to already crashed containers
-					s.attachContainer(ctx, container, listener, project) // nolint: errcheck
-					delete(crashed, event.Container)
-
-					s.waitContainer(ctx, container, listener)
-				}
-				return nil
-			},
-		})
-	}()
-
-	return containers, err
+	return containers, nil
 }
 
-func (s *composeService) attachContainer(ctx context.Context, container moby.Container, listener compose.ContainerEventListener, project *types.Project) error {
+func (s *composeService) attachContainer(ctx context.Context, container moby.Container, consumer compose.ContainerEventListener, project *types.Project) error {
 	serviceName := container.Labels[serviceLabel]
-	w := utils.GetWriter(getContainerNameWithoutProject(container), serviceName, container.ID, listener)
+	w := utils.GetWriter(getContainerNameWithoutProject(container), serviceName, container.ID, consumer)
 
 	service, err := project.GetService(serviceName)
 	if err != nil {
 		return err
 	}
 
-	listener(compose.ContainerEvent{
-		Type:    compose.ContainerEventAttach,
-		Source:  container.ID,
-		Name:    getContainerNameWithoutProject(container),
-		Service: container.Labels[serviceLabel],
-	})
-
-	return s.attachContainerStreams(ctx, container.ID, service.Tty, nil, w)
+	return s.attachContainerStreams(ctx, container, service.Tty, nil, w)
 }
 
-func (s *composeService) attachContainerStreams(ctx context.Context, container string, tty bool, r io.Reader, w io.Writer) error {
+func (s *composeService) attachContainerStreams(ctx context.Context, container moby.Container, tty bool, r io.Reader, w io.Writer) error {
 	stdin, stdout, err := s.getContainerStreams(ctx, container)
 	if err != nil {
 		return err
@@ -144,30 +105,32 @@ func (s *composeService) attachContainerStreams(ctx context.Context, container s
 	return nil
 }
 
-func (s *composeService) getContainerStreams(ctx context.Context, container string) (io.WriteCloser, io.ReadCloser, error) {
+func (s *composeService) getContainerStreams(ctx context.Context, container moby.Container) (io.WriteCloser, io.ReadCloser, error) {
 	var stdout io.ReadCloser
 	var stdin io.WriteCloser
-	cnx, err := s.apiClient.ContainerAttach(ctx, container, moby.ContainerAttachOptions{
-		Stream: true,
-		Stdin:  true,
-		Stdout: true,
-		Stderr: true,
-		Logs:   false,
-	})
-	if err == nil {
+	if container.State == convert.ContainerRunning {
+		logs, err := s.apiClient.ContainerLogs(ctx, container.ID, moby.ContainerLogsOptions{
+			ShowStdout: true,
+			ShowStderr: true,
+			Follow:     true,
+		})
+		if err != nil {
+			return nil, nil, err
+		}
+		stdout = logs
+	} else {
+		cnx, err := s.apiClient.ContainerAttach(ctx, container.ID, moby.ContainerAttachOptions{
+			Stream: true,
+			Stdin:  true,
+			Stdout: true,
+			Stderr: true,
+			Logs:   false,
+		})
+		if err != nil {
+			return nil, nil, err
+		}
 		stdout = convert.ContainerStdout{HijackedResponse: cnx}
 		stdin = convert.ContainerStdin{HijackedResponse: cnx}
-		return stdin, stdout, nil
-	}
-
-	// Fallback to logs API
-	logs, err := s.apiClient.ContainerLogs(ctx, container, moby.ContainerLogsOptions{
-		ShowStdout: true,
-		ShowStderr: true,
-		Follow:     true,
-	})
-	if err != nil {
-		return nil, nil, err
 	}
-	return stdin, logs, nil
+	return stdin, stdout, nil
 }
diff --git a/local/compose/build.go b/local/compose/build.go
index 2a885660..d4fce77f 100644
--- a/local/compose/build.go
+++ b/local/compose/build.go
@@ -26,14 +26,12 @@ import (
 	"github.com/docker/compose-cli/api/compose"
 
 	"github.com/compose-spec/compose-go/types"
-	"github.com/containerd/containerd/platforms"
 	"github.com/docker/buildx/build"
 	"github.com/docker/buildx/driver"
 	_ "github.com/docker/buildx/driver/docker" // required to get default driver registered
 	"github.com/docker/buildx/util/progress"
 	"github.com/docker/docker/errdefs"
 	bclient "github.com/moby/buildkit/client"
-	specs "github.com/opencontainers/image-spec/specs-go/v1"
 )
 
 func (s *composeService) Build(ctx context.Context, project *types.Project, options compose.BuildOptions) error {
@@ -43,10 +41,7 @@ func (s *composeService) Build(ctx context.Context, project *types.Project, opti
 		if service.Build != nil {
 			imageName := getImageName(service, project.Name)
 			imagesToBuild = append(imagesToBuild, imageName)
-			buildOptions, err := s.toBuildOptions(service, project.WorkingDir, imageName)
-			if err != nil {
-				return err
-			}
+			buildOptions := s.toBuildOptions(service, project.WorkingDir, imageName)
 			buildOptions.Pull = options.Pull
 			buildOptions.BuildArgs = options.Args
 			opts[imageName] = buildOptions
@@ -55,13 +50,13 @@ func (s *composeService) Build(ctx context.Context, project *types.Project, opti
 
 	err := s.build(ctx, project, opts, options.Progress)
 	if err == nil {
-		displayScanSuggestMsg(imagesToBuild)
+		displayScanSuggestMsg(ctx, imagesToBuild)
 	}
 
 	return err
 }
 
-func (s *composeService) ensureImagesExists(ctx context.Context, project *types.Project) error {
+func (s *composeService) ensureImagesExists(ctx context.Context, project *types.Project, quietPull bool) error {
 	opts := map[string]build.Options{}
 	imagesToBuild := []string{}
 	for _, service := range project.Services {
@@ -80,10 +75,7 @@ func (s *composeService) ensureImagesExists(ctx context.Context, project *types.
 				continue
 			}
 			imagesToBuild = append(imagesToBuild, imageName)
-			opts[imageName], err = s.toBuildOptions(service, project.WorkingDir, imageName)
-			if err != nil {
-				return err
-			}
+			opts[imageName] = s.toBuildOptions(service, project.WorkingDir, imageName)
 			continue
 		}
 		if service.Image != "" {
@@ -106,9 +98,14 @@ func (s *composeService) ensureImagesExists(ctx context.Context, project *types.
 
 	}
 
-	err := s.build(ctx, project, opts, "auto")
+	mode := progress.PrinterModeAuto
+	if quietPull {
+		mode = progress.PrinterModeQuiet
+	}
+
+	err := s.build(ctx, project, opts, mode)
 	if err == nil {
-		displayScanSuggestMsg(imagesToBuild)
+		displayScanSuggestMsg(ctx, imagesToBuild)
 	}
 	return err
 }
@@ -156,7 +153,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opts
 	return err
 }
 
-func (s *composeService) toBuildOptions(service types.ServiceConfig, contextPath string, imageTag string) (build.Options, error) {
+func (s *composeService) toBuildOptions(service types.ServiceConfig, contextPath string, imageTag string) build.Options {
 	var tags []string
 	tags = append(tags, imageTag)
 
@@ -165,15 +162,6 @@ func (s *composeService) toBuildOptions(service types.ServiceConfig, contextPath
 	}
 	var buildArgs map[string]string
 
-	var plats []specs.Platform
-	if service.Platform != "" {
-		p, err := platforms.Parse(service.Platform)
-		if err != nil {
-			return build.Options{}, err
-		}
-		plats = append(plats, p)
-	}
-
 	return build.Options{
 		Inputs: build.Inputs{
 			ContextPath:    path.Join(contextPath, service.Build.Context),
@@ -183,8 +171,7 @@ func (s *composeService) toBuildOptions(service types.ServiceConfig, contextPath
 		Tags:      tags,
 		Target:    service.Build.Target,
 		Exports:   []bclient.ExportEntry{{Type: "image", Attrs: map[string]string{}}},
-		Platforms: plats,
-	}, nil
+	}
 }
 
 func flatten(in types.MappingWithEquals) map[string]string {
diff --git a/local/compose/convergence.go b/local/compose/convergence.go
index bcd09b0a..fe0571a5 100644
--- a/local/compose/convergence.go
+++ b/local/compose/convergence.go
@@ -23,11 +23,9 @@ import (
 	"time"
 
 	"github.com/compose-spec/compose-go/types"
-	"github.com/containerd/containerd/platforms"
 	moby "github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/filters"
 	"github.com/docker/docker/api/types/network"
-	specs "github.com/opencontainers/image-spec/specs-go/v1"
 	"golang.org/x/sync/errgroup"
 
 	"github.com/docker/compose-cli/api/compose"
@@ -66,7 +64,7 @@ func (s *composeService) ensureScale(ctx context.Context, project *types.Project
 			number := next + i
 			name := getContainerName(project.Name, service, number)
 			eg.Go(func() error {
-				return s.createContainer(ctx, project, service, name, number, false, true)
+				return s.createContainer(ctx, project, service, name, number, false)
 			})
 		}
 	}
@@ -199,11 +197,11 @@ func getScale(config types.ServiceConfig) (int, error) {
 	return scale, err
 }
 
-func (s *composeService) createContainer(ctx context.Context, project *types.Project, service types.ServiceConfig, name string, number int, autoRemove bool, useNetworkAliases bool) error {
+func (s *composeService) createContainer(ctx context.Context, project *types.Project, service types.ServiceConfig, name string, number int, autoRemove bool) error {
 	w := progress.ContextWriter(ctx)
 	eventName := "Container " + name
 	w.Event(progress.CreatingEvent(eventName))
-	err := s.createMobyContainer(ctx, project, service, name, number, nil, autoRemove, useNetworkAliases)
+	err := s.createMobyContainer(ctx, project, service, name, number, nil, autoRemove)
 	if err != nil {
 		return err
 	}
@@ -233,7 +231,7 @@ func (s *composeService) recreateContainer(ctx context.Context, project *types.P
 	if inherit {
 		inherited = &container
 	}
-	err = s.createMobyContainer(ctx, project, service, name, number, inherited, false, true)
+	err = s.createMobyContainer(ctx, project, service, name, number, inherited, false)
 	if err != nil {
 		return err
 	}
@@ -270,10 +268,8 @@ func (s *composeService) restartContainer(ctx context.Context, container moby.Co
 	return nil
 }
 
-func (s *composeService) createMobyContainer(ctx context.Context, project *types.Project, service types.ServiceConfig, name string, number int,
-	inherit *moby.Container,
-	autoRemove bool,
-	useNetworkAliases bool) error {
+func (s *composeService) createMobyContainer(ctx context.Context, project *types.Project, service types.ServiceConfig, name string, number int, inherit *moby.Container,
+	autoRemove bool) error {
 	cState, err := GetContextContainerState(ctx)
 	if err != nil {
 		return err
@@ -282,15 +278,7 @@ func (s *composeService) createMobyContainer(ctx context.Context, project *types
 	if err != nil {
 		return err
 	}
-	var plat *specs.Platform
-	if service.Platform != "" {
-		p, err := platforms.Parse(service.Platform)
-		if err != nil {
-			return err
-		}
-		plat = &p
-	}
-	created, err := s.apiClient.ContainerCreate(ctx, containerConfig, hostConfig, networkingConfig, plat, name)
+	created, err := s.apiClient.ContainerCreate(ctx, containerConfig, hostConfig, networkingConfig, nil, name)
 	if err != nil {
 		return err
 	}
@@ -299,16 +287,9 @@ func (s *composeService) createMobyContainer(ctx context.Context, project *types
 		Labels: containerConfig.Labels,
 	}
 	cState.Add(createdContainer)
-	for netName, cfg := range service.Networks {
+	for netName := range service.Networks {
 		netwrk := project.Networks[netName]
-		aliases := []string{getContainerName(project.Name, service, number)}
-		if useNetworkAliases {
-			aliases = append(aliases, service.Name)
-			if cfg != nil {
-				aliases = append(aliases, cfg.Aliases...)
-			}
-		}
-		err = s.connectContainerToNetwork(ctx, created.ID, netwrk.Name, aliases...)
+		err = s.connectContainerToNetwork(ctx, created.ID, netwrk.Name, service.Name, getContainerName(project.Name, service, number))
 		if err != nil {
 			return err
 		}
diff --git a/local/compose/create.go b/local/compose/create.go
index dbe2732d..5496ec04 100644
--- a/local/compose/create.go
+++ b/local/compose/create.go
@@ -46,7 +46,7 @@ func (s *composeService) Create(ctx context.Context, project *types.Project, opt
 		opts.Services = project.ServiceNames()
 	}
 
-	err := s.ensureImagesExists(ctx, project)
+	err := s.ensureImagesExists(ctx, project, opts.QuietPull)
 	if err != nil {
 		return err
 	}
@@ -272,7 +272,6 @@ func (s *composeService) getCreateOptions(ctx context.Context, p *types.Project,
 	if err != nil {
 		return nil, nil, nil, err
 	}
-
 	hostConfig := container.HostConfig{
 		AutoRemove:     autoRemove,
 		Binds:          binds,
@@ -282,7 +281,6 @@ func (s *composeService) getCreateOptions(ctx context.Context, p *types.Project,
 		NetworkMode:    networkMode,
 		Init:           service.Init,
 		ReadonlyRootfs: service.ReadOnly,
-		RestartPolicy:  getRestartPolicy(service),
 		// ShmSize: , TODO
 		Sysctls:      service.Sysctls,
 		PortBindings: portBindings,
@@ -295,33 +293,6 @@ func (s *composeService) getCreateOptions(ctx context.Context, p *types.Project,
 	return &containerConfig, &hostConfig, networkConfig, nil
 }
 
-func getRestartPolicy(service types.ServiceConfig) container.RestartPolicy {
-	var restart container.RestartPolicy
-	if service.Restart != "" {
-		split := strings.Split(service.Restart, ":")
-		var attempts int
-		if len(split) > 1 {
-			attempts, _ = strconv.Atoi(split[1])
-		}
-		restart = container.RestartPolicy{
-			Name:              split[0],
-			MaximumRetryCount: attempts,
-		}
-	}
-	if service.Deploy != nil && service.Deploy.RestartPolicy != nil {
-		policy := *service.Deploy.RestartPolicy
-		var attempts int
-		if policy.MaxAttempts != nil {
-			attempts = int(*policy.MaxAttempts)
-		}
-		restart = container.RestartPolicy{
-			Name:              policy.Condition,
-			MaximumRetryCount: attempts,
-		}
-	}
-	return restart
-}
-
 func getDeployResources(s types.ServiceConfig) container.Resources {
 	resources := container.Resources{}
 	if s.Deploy == nil {
diff --git a/local/compose/events.go b/local/compose/events.go
deleted file mode 100644
index 8024622d..00000000
--- a/local/compose/events.go
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package compose
-
-import (
-	"context"
-	"strings"
-	"time"
-
-	"github.com/docker/compose-cli/api/compose"
-	"github.com/docker/compose-cli/utils"
-
-	moby "github.com/docker/docker/api/types"
-	"github.com/docker/docker/api/types/filters"
-)
-
-func (s *composeService) Events(ctx context.Context, project string, options compose.EventsOptions) error {
-	events, errors := s.apiClient.Events(ctx, moby.EventsOptions{
-		Filters: filters.NewArgs(projectFilter(project)),
-	})
-	for {
-		select {
-		case event := <-events:
-			// TODO: support other event types
-			if event.Type != "container" {
-				continue
-			}
-
-			service := event.Actor.Attributes[serviceLabel]
-			if len(options.Services) > 0 && !utils.StringContains(options.Services, service) {
-				continue
-			}
-
-			attributes := map[string]string{}
-			for k, v := range event.Actor.Attributes {
-				if strings.HasPrefix(k, "com.docker.compose.") {
-					continue
-				}
-				attributes[k] = v
-			}
-
-			timestamp := time.Unix(event.Time, 0)
-			if event.TimeNano != 0 {
-				timestamp = time.Unix(0, event.TimeNano)
-			}
-			err := options.Consumer(compose.Event{
-				Timestamp:  timestamp,
-				Service:    service,
-				Container:  event.ID,
-				Status:     event.Status,
-				Attributes: attributes,
-			})
-			if err != nil {
-				return err
-			}
-
-		case err := <-errors:
-			return err
-		}
-	}
-}
diff --git a/local/compose/pull.go b/local/compose/pull.go
index 9c4772fe..dd66bf0e 100644
--- a/local/compose/pull.go
+++ b/local/compose/pull.go
@@ -96,7 +96,6 @@ func (s *composeService) Pull(ctx context.Context, project *types.Project) error
 
 			stream, err := s.apiClient.ImagePull(ctx, service.Image, moby.ImagePullOptions{
 				RegistryAuth: base64.URLEncoding.EncodeToString(buf),
-				Platform:     service.Platform,
 			})
 			if err != nil {
 				w.Event(progress.Event{
diff --git a/local/compose/push.go b/local/compose/push.go
index 67056fd3..b0de803f 100644
--- a/local/compose/push.go
+++ b/local/compose/push.go
@@ -33,12 +33,11 @@ import (
 	"github.com/pkg/errors"
 	"golang.org/x/sync/errgroup"
 
-	"github.com/docker/compose-cli/api/compose"
 	"github.com/docker/compose-cli/api/config"
 	"github.com/docker/compose-cli/api/progress"
 )
 
-func (s *composeService) Push(ctx context.Context, project *types.Project, options compose.PushOptions) error {
+func (s *composeService) Push(ctx context.Context, project *types.Project) error {
 	configFile, err := cliconfig.Load(config.Dir(ctx))
 	if err != nil {
 		return err
@@ -65,25 +64,13 @@ func (s *composeService) Push(ctx context.Context, project *types.Project, optio
 		}
 		service := service
 		eg.Go(func() error {
-			err := s.pushServiceImage(ctx, service, info, configFile, w)
-			if err != nil {
-				if !options.IgnoreFailures {
-					return err
-				}
-				w.Event(progress.Event{
-					ID:         fmt.Sprintf("Pushing %s:", service.Name),
-					Text:       fmt.Sprintf("%v", err),
-					Status:     progress.Error,
-					StatusText: fmt.Sprintf("%s", err),
-				})
-			}
-			return nil
+			return s.pullServiceImage(ctx, service, info, configFile, w)
 		})
 	}
 	return eg.Wait()
 }
 
-func (s *composeService) pushServiceImage(ctx context.Context, service types.ServiceConfig, info moby.Info, configFile driver.Auth, w progress.Writer) error {
+func (s *composeService) pullServiceImage(ctx context.Context, service types.ServiceConfig, info moby.Info, configFile driver.Auth, w progress.Writer) error {
 	ref, err := reference.ParseNormalizedNamed(service.Image)
 	if err != nil {
 		return err
@@ -126,7 +113,7 @@ func (s *composeService) pushServiceImage(ctx context.Context, service types.Ser
 		if jm.Error != nil {
 			return errors.New(jm.Error.Message)
 		}
-		toPushProgressEvent(service.Name, jm, w)
+		toPushProgressEvent("Pushing "+service.Name, jm, w)
 	}
 	return nil
 }
diff --git a/local/compose/run.go b/local/compose/run.go
index 0fab5a94..0fa56fdd 100644
--- a/local/compose/run.go
+++ b/local/compose/run.go
@@ -56,13 +56,13 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
 	service.Labels = service.Labels.Add(slugLabel, slug)
 	service.Labels = service.Labels.Add(oneoffLabel, "True")
 
-	if err := s.ensureImagesExists(ctx, project); err != nil { // all dependencies already checked, but might miss service img
+	if err := s.ensureImagesExists(ctx, project, false); err != nil { // all dependencies already checked, but might miss service img
 		return 0, err
 	}
 	if err := s.waitDependencies(ctx, project, service); err != nil {
 		return 0, err
 	}
-	if err := s.createContainer(ctx, project, service, service.ContainerName, 1, opts.AutoRemove, opts.UseNetworkAliases); err != nil {
+	if err := s.createContainer(ctx, project, service, service.ContainerName, 1, opts.AutoRemove); err != nil {
 		return 0, err
 	}
 	containerID := service.ContainerName
@@ -86,7 +86,7 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
 		return 0, err
 	}
 	oneoffContainer := containers[0]
-	err = s.attachContainerStreams(ctx, oneoffContainer.ID, service.Tty, opts.Reader, opts.Writer)
+	err = s.attachContainerStreams(ctx, oneoffContainer, service.Tty, opts.Reader, opts.Writer)
 	if err != nil {
 		return 0, err
 	}
diff --git a/local/compose/scan_suggest.go b/local/compose/scan_suggest.go
index 3a7eb82b..2d5ab0fe 100644
--- a/local/compose/scan_suggest.go
+++ b/local/compose/scan_suggest.go
@@ -17,6 +17,7 @@
 package compose
 
 import (
+	"context"
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
@@ -25,24 +26,25 @@ import (
 
 	pluginmanager "github.com/docker/cli/cli-plugins/manager"
 	"github.com/docker/cli/cli/command"
-	cliConfig "github.com/docker/cli/cli/config"
+	"github.com/docker/compose-cli/api/config"
 )
 
-func displayScanSuggestMsg(builtImages []string) {
+func displayScanSuggestMsg(ctx context.Context, builtImages []string) {
 	if len(builtImages) <= 0 {
 		return
 	}
 	if os.Getenv("DOCKER_SCAN_SUGGEST") == "false" {
 		return
 	}
-	if !scanAvailable() || scanAlreadyInvoked() {
+	if !scanAvailable() || scanAlreadyInvoked(ctx) {
 		return
 	}
 	fmt.Println("Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them")
 }
 
-func scanAlreadyInvoked() bool {
-	filename := filepath.Join(cliConfig.Dir(), "scan", "config.json")
+func scanAlreadyInvoked(ctx context.Context) bool {
+	configDir := config.Dir(ctx)
+	filename := filepath.Join(configDir, "scan", "config.json")
 	f, err := os.Stat(filename)
 	if os.IsNotExist(err) {
 		return false
diff --git a/local/compose/start.go b/local/compose/start.go
index 4716ca87..10582547 100644
--- a/local/compose/start.go
+++ b/local/compose/start.go
@@ -22,7 +22,6 @@ import (
 	"github.com/docker/compose-cli/api/compose"
 
 	"github.com/compose-spec/compose-go/types"
-	moby "github.com/docker/docker/api/types"
 	"github.com/docker/docker/api/types/container"
 	"github.com/sirupsen/logrus"
 )
@@ -51,25 +50,20 @@ func (s *composeService) Start(ctx context.Context, project *types.Project, opti
 	for _, c := range containers {
 		c := c
 		go func() {
-			s.waitContainer(ctx, c, options.Attach)
+			statusC, errC := s.apiClient.ContainerWait(context.Background(), c.ID, container.WaitConditionNotRunning)
+			select {
+			case status := <-statusC:
+				options.Attach(compose.ContainerEvent{
+					Type:     compose.ContainerEventExit,
+					Source:   c.ID,
+					Name:     getCanonicalContainerName(c),
+					Service:  c.Labels[serviceLabel],
+					ExitCode: int(status.StatusCode),
+				})
+			case err := <-errC:
+				logrus.Warnf("Unexpected API error for %s : %s\n", getCanonicalContainerName(c), err.Error())
+			}
 		}()
 	}
 	return nil
 }
-
-func (s *composeService) waitContainer(ctx context.Context, c moby.Container, listener compose.ContainerEventListener) {
-	statusC, errC := s.apiClient.ContainerWait(ctx, c.ID, container.WaitConditionNotRunning)
-	name := getCanonicalContainerName(c)
-	select {
-	case status := <-statusC:
-		listener(compose.ContainerEvent{
-			Type:     compose.ContainerEventExit,
-			Source:   c.ID,
-			Name:     name,
-			Service:  c.Labels[serviceLabel],
-			ExitCode: int(status.StatusCode),
-		})
-	case err := <-errC:
-		logrus.Warnf("Unexpected API error for %s : %s", name, err.Error())
-	}
-}
diff --git a/local/compose/top.go b/local/compose/top.go
deleted file mode 100644
index 24549e99..00000000
--- a/local/compose/top.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-   Copyright 2020 Docker Compose CLI authors
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-*/
-
-package compose
-
-import (
-	"context"
-
-	"github.com/docker/compose-cli/api/compose"
-	moby "github.com/docker/docker/api/types"
-	"github.com/docker/docker/api/types/filters"
-	"golang.org/x/sync/errgroup"
-)
-
-func (s *composeService) Top(ctx context.Context, projectName string, services []string) ([]compose.ContainerProcSummary, error) {
-	var containers Containers
-	containers, err := s.apiClient.ContainerList(ctx, moby.ContainerListOptions{
-		Filters: filters.NewArgs(projectFilter(projectName)),
-	})
-	if err != nil {
-		return nil, err
-	}
-	if len(services) > 0 {
-		containers = containers.filter(isService(services...))
-	}
-	summary := make([]compose.ContainerProcSummary, len(containers))
-	eg, ctx := errgroup.WithContext(ctx)
-	for i, c := range containers {
-		container := c
-		i := i
-		eg.Go(func() error {
-			topContent, err := s.apiClient.ContainerTop(ctx, container.ID, []string{})
-			if err != nil {
-				return err
-			}
-			summary[i] = compose.ContainerProcSummary{
-				ID:        container.ID,
-				Name:      getCanonicalContainerName(container),
-				Processes: topContent.Processes,
-				Titles:    topContent.Titles,
-			}
-			return nil
-		})
-	}
-	return summary, eg.Wait()
-}
diff --git a/local/containers.go b/local/containers.go
index f2b28738..e3e72d25 100644
--- a/local/containers.go
+++ b/local/containers.go
@@ -39,11 +39,10 @@ import (
 )
 
 type containerService struct {
-	apiClient client.APIClient
+	apiClient *client.Client
 }
 
 func (cs *containerService) Inspect(ctx context.Context, id string) (containers.Container, error) {
-
 	c, err := cs.apiClient.ContainerInspect(ctx, id)
 	if err != nil {
 		return containers.Container{}, err
diff --git a/local/volumes.go b/local/volumes.go
index 9b49aaf4..2fbf08b7 100644
--- a/local/volumes.go
+++ b/local/volumes.go
@@ -29,7 +29,7 @@ import (
 )
 
 type volumeService struct {
-	apiClient client.APIClient
+	apiClient *client.Client
 }
 
 func (vs *volumeService) List(ctx context.Context) ([]volumes.Volume, error) {
diff --git a/scripts/install/install_linux.sh b/scripts/install/install_linux.sh
index 54126d37..ace08caa 100644
--- a/scripts/install/install_linux.sh
+++ b/scripts/install/install_linux.sh
@@ -106,11 +106,7 @@ if ! [ "$(command -v curl)" ]; then
 	exit 1
 fi
 
-if [ "$(uname -m)" = "aarch64" ]; then
-	DOWNLOAD_URL=${DOWNLOAD_URL:-$(curl -s ${RELEASE_URL} | grep "browser_download_url.*docker-linux-arm64.tar.gz" | cut -d : -f 2,3)}
-else
-	DOWNLOAD_URL=${DOWNLOAD_URL:-$(curl -s ${RELEASE_URL} | grep "browser_download_url.*docker-linux-amd64.tar.gz" | cut -d : -f 2,3)}
-fi
+DOWNLOAD_URL=${DOWNLOAD_URL:-$(curl -s ${RELEASE_URL} | grep "browser_download_url.*docker-linux-amd64.tar.gz" | cut -d : -f 2,3)}
 
 # Check if the Compose CLI is already installed
 if [ $(is_new_cli "docker") -eq 1 ]; then


Test patch:
diff --git a/cli/main_test.go b/cli/main_test.go
index 3a0ee145..bb62ee04 100644
--- a/cli/main_test.go
+++ b/cli/main_test.go
@@ -44,24 +44,20 @@ func TestDetermineCurrentContext(t *testing.T) {
 	assert.NilError(t, err)
 
 	// If nothing set, fallback to default
-	c := determineCurrentContext("", "", []string{})
+	c := determineCurrentContext("", "")
 	assert.Equal(t, c, "default")
 
 	// If context flag set, use that
-	c = determineCurrentContext("other-context", "", []string{})
+	c = determineCurrentContext("other-context", "")
 	assert.Equal(t, c, "other-context")
 
 	// If no context flag, use config
-	c = determineCurrentContext("", d, []string{})
+	c = determineCurrentContext("", d)
 	assert.Equal(t, c, "some-context")
 
 	// Ensure context flag overrides config
-	c = determineCurrentContext("other-context", d, []string{})
+	c = determineCurrentContext("other-context", d)
 	assert.Equal(t, "other-context", c)
-
-	// Ensure host flag overrides context
-	c = determineCurrentContext("other-context", d, []string{"hostname"})
-	assert.Equal(t, "default", c)
 }
 
 func TestCheckOwnCommand(t *testing.T) {
diff --git a/local/e2e/cli-only/e2e_test.go b/local/e2e/cli-only/e2e_test.go
index 21136ab1..40faf6f9 100644
--- a/local/e2e/cli-only/e2e_test.go
+++ b/local/e2e/cli-only/e2e_test.go
@@ -396,19 +396,15 @@ func TestLegacy(t *testing.T) {
 	})
 
 	t.Run("host flag", func(t *testing.T) {
-		res := c.RunDockerOrExitError("-H", "tcp://nonexistent:123", "version")
-		assert.Assert(t, res.ExitCode == 1)
-		assert.Assert(t, strings.Contains(res.Stdout(), "dial tcp: lookup nonexistent"), res.Stdout())
-
-	})
-
-	t.Run("remote engine context", func(t *testing.T) {
-		c.RunDockerCmd("context", "create", "test-remote-engine", "--docker", "host=tcp://nonexistent:1234")
-		c.RunDockerCmd("context", "use", "test-remote-engine")
-
-		res := c.RunDockerOrExitError("version")
-		assert.Assert(t, res.ExitCode == 1)
-		assert.Assert(t, strings.Contains(res.Stdout(), "dial tcp: lookup nonexistent"), res.Stdout())
+		stderr := "Cannot connect to the Docker daemon at tcp://localhost:123"
+		if runtime.GOOS == "windows" {
+			stderr = "error during connect: Get http://localhost:123"
+		}
+		res := c.RunDockerOrExitError("-H", "tcp://localhost:123", "version")
+		res.Assert(t, icmd.Expected{
+			ExitCode: 1,
+			Err:      stderr,
+		})
 	})
 
 	t.Run("existing contexts delegate", func(t *testing.T) {
diff --git a/local/e2e/compose/compose_run_test.go b/local/e2e/compose/compose_run_test.go
index 59fb75e9..777d3869 100644
--- a/local/e2e/compose/compose_run_test.go
+++ b/local/e2e/compose/compose_run_test.go
@@ -17,7 +17,6 @@
 package e2e
 
 import (
-	"os"
 	"strings"
 	"testing"
 
@@ -84,20 +83,4 @@ func TestLocalComposeRun(t *testing.T) {
 		res := c.RunDockerCmd("ps", "--all")
 		assert.Assert(t, !strings.Contains(res.Stdout(), "run-test"), res.Stdout())
 	})
-
-	t.Run("compose run --volumes", func(t *testing.T) {
-		wd, err := os.Getwd()
-		assert.NilError(t, err)
-		res := c.RunDockerCmd("compose", "-f", "./fixtures/run-test/compose.yml", "run", "--volumes", wd+":/foo", "back", "/bin/sh", "-c", "ls /foo")
-		res.Assert(t, icmd.Expected{Out: "compose_run_test.go"})
-
-		res = c.RunDockerCmd("ps", "--all")
-		assert.Assert(t, strings.Contains(res.Stdout(), "run-test_back"), res.Stdout())
-	})
-
-	t.Run("compose run --publish", func(t *testing.T) {
-		c.RunDockerCmd("compose", "-f", "./fixtures/run-test/compose.yml", "run", "--rm", "--publish", "8080:80", "-d", "back", "/bin/sh", "-c", "sleep 10")
-		res := c.RunDockerCmd("ps")
-		assert.Assert(t, strings.Contains(res.Stdout(), "8080->80/tcp"), res.Stdout())
-	})
 }
diff --git a/local/e2e/compose/compose_test.go b/local/e2e/compose/compose_test.go
index 25b69b66..dc8008f2 100644
--- a/local/e2e/compose/compose_test.go
+++ b/local/e2e/compose/compose_test.go
@@ -65,14 +65,6 @@ func TestLocalComposeUp(t *testing.T) {
 		res.Assert(t, icmd.Expected{Out: projectName + "_default"})
 	})
 
-	t.Run("top", func(t *testing.T) {
-		res := c.RunDockerCmd("compose", "-p", projectName, "top")
-		output := res.Stdout()
-		assert.Assert(t, strings.Contains(output, `UID    PID     PPID    C    STIME   TTY   TIME       CMD`))
-		assert.Assert(t, strings.Contains(output, `java -Xmx8m -Xms8m -jar /app/words.jar`))
-		assert.Assert(t, strings.Contains(output, `/dispatcher`))
-	})
-
 	t.Run("check compose labels", func(t *testing.T) {
 		wd, _ := os.Getwd()
 		res := c.RunDockerCmd("inspect", projectName+"_web_1")
@@ -132,17 +124,3 @@ func TestComposePull(t *testing.T) {
 	assert.Assert(t, strings.Contains(output, "simple Pulled"))
 	assert.Assert(t, strings.Contains(output, "another Pulled"))
 }
-
-func TestAttachRestart(t *testing.T) {
-	c := NewParallelE2eCLI(t, binDir)
-
-	res := c.RunDockerOrExitError("compose", "--ansi=never", "--project-directory", "fixtures/attach-restart", "up")
-	output := res.Stdout()
-
-	assert.Assert(t, strings.Contains(output, `another_1  | world
-attach-restart_another_1 exited with code 1
-another_1  | world
-attach-restart_another_1 exited with code 1
-another_1  | world
-attach-restart_another_1 exited with code 1`), res.Combined())
-}
diff --git a/local/e2e/compose/fixtures/attach-restart/compose.yaml b/local/e2e/compose/fixtures/attach-restart/compose.yaml
deleted file mode 100644
index 0253fa03..00000000
--- a/local/e2e/compose/fixtures/attach-restart/compose.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-services:
-  simple:
-    image: busybox:1.31.0-uclibc
-    command: sh -c "sleep 5"
-  another:
-    image: busybox:1.31.0-uclibc
-    command: sh -c "sleep 0.1 && echo world && /bin/false"
-    deploy:
-      restart_policy:
-        condition: "on-failure"
-        max_attempts: 2