Skip to content

Commit

Permalink
Merge pull request #1469 from rsteube/docker-buildx-updates
Browse files Browse the repository at this point in the history
docker-buildx: updates from v0.9.1
  • Loading branch information
rsteube authored Jan 7, 2023
2 parents 40e3cbb + e7c0ab4 commit 48635f4
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 21 deletions.
9 changes: 5 additions & 4 deletions completers/docker-buildx_completer/cmd/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
)

var bakeCmd = &cobra.Command{
Use: "bake",
Short: "Build from a file",
Run: func(cmd *cobra.Command, args []string) {},
Use: "bake [OPTIONS] [TARGET...]",
Short: "Build from a file",
Aliases: []string{"f"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
Expand All @@ -19,7 +20,7 @@ func init() {
bakeCmd.Flags().Bool("no-cache", false, "Do not use cache when building the image")
bakeCmd.Flags().Bool("print", false, "Print the options without building")
bakeCmd.Flags().String("progress", "auto", "Set type of progress output (\"auto\", \"plain\", \"tty\"). Use plain to show container output")
bakeCmd.Flags().Bool("pull", false, "Always attempt to pull a newer version of the image")
bakeCmd.Flags().Bool("pull", false, "Always attempt to pull all referenced images")
bakeCmd.Flags().Bool("push", false, "Shorthand for \"--set=*.output=type=registry\"")
bakeCmd.Flags().StringArray("set", []string{}, "Override target value (e.g., \"targetpattern.key=value\")")
rootCmd.AddCommand(bakeCmd)
Expand Down
12 changes: 7 additions & 5 deletions completers/docker-buildx_completer/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
)

var buildCmd = &cobra.Command{
Use: "build",
Short: "Start a build",
Run: func(cmd *cobra.Command, args []string) {},
Use: "build [OPTIONS] PATH | URL | -",
Short: "Start a build",
Aliases: []string{"b"},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
Expand Down Expand Up @@ -38,14 +39,15 @@ func init() {
buildCmd.Flags().String("metadata-file", "", "Write build result metadata to the file")
buildCmd.Flags().String("network", "default", "Set the networking mode for the \"RUN\" instructions during build")
buildCmd.Flags().Bool("no-cache", false, "Do not use cache when building the image")
buildCmd.Flags().StringArray("no-cache-filter", []string{}, "Do not cache specified stages")
buildCmd.Flags().StringArrayP("output", "o", []string{}, "Output destination (format: \"type=local,dest=path\")")
buildCmd.Flags().StringArray("platform", []string{}, "Set target platform for build")
buildCmd.Flags().String("progress", "auto", "Set type of progress output (\"auto\", \"plain\", \"tty\"). Use plain to show container output")
buildCmd.Flags().Bool("pull", false, "Always attempt to pull a newer version of the image")
buildCmd.Flags().Bool("pull", false, "Always attempt to pull all referenced images")
buildCmd.Flags().Bool("push", false, "Shorthand for \"--output=type=registry\"")
buildCmd.Flags().BoolP("quiet", "q", false, "Suppress the build output and print image ID on success")
buildCmd.Flags().Bool("rm", false, "Remove intermediate containers after a successful build")
buildCmd.Flags().StringArray("secret", []string{}, "Secret file to expose to the build (format: \"id=mysecret,src=/local/secret\")")
buildCmd.Flags().StringArray("secret", []string{}, "Secret to expose to the build (format: \"id=mysecret[,src=/local/secret]\")")
buildCmd.Flags().StringSlice("security-opt", []string{}, "Security options")
buildCmd.Flags().String("shm-size", "", "Size of \"/dev/shm\"")
buildCmd.Flags().Bool("squash", false, "Squash newly built layers into a single new layer")
Expand Down
4 changes: 2 additions & 2 deletions completers/docker-buildx_completer/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

var createCmd = &cobra.Command{
Use: "create",
Use: "create [OPTIONS] [CONTEXT|ENDPOINT]",
Short: "Create a new builder instance",
Run: func(cmd *cobra.Command, args []string) {},
}
Expand All @@ -17,7 +17,7 @@ func init() {
createCmd.Flags().Bool("bootstrap", false, "Boot builder after creation")
createCmd.Flags().String("buildkitd-flags", "", "Flags for buildkitd daemon")
createCmd.Flags().String("config", "", "BuildKit config file")
createCmd.Flags().String("driver", "", "Driver to use (available: \"docker\", \"docker-container\", \"kubernetes\")")
createCmd.Flags().String("driver", "", "Driver to use (available: \"docker-container\", \"kubernetes\", \"remote\")")
createCmd.Flags().StringArray("driver-opt", []string{}, "Options for the driver")
createCmd.Flags().Bool("leave", false, "Remove a node from builder instead of changing it")
createCmd.Flags().String("name", "", "Builder instance name")
Expand Down
6 changes: 4 additions & 2 deletions completers/docker-buildx_completer/cmd/imagetools_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var imagetools_createCmd = &cobra.Command{
Use: "create",
Use: "create [OPTIONS] [SOURCE] [SOURCE...]",
Short: "Create a new image based on source images",
Run: func(cmd *cobra.Command, args []string) {},
}
Expand All @@ -17,11 +17,13 @@ func init() {
imagetools_createCmd.Flags().Bool("append", false, "Append to existing manifest")
imagetools_createCmd.Flags().Bool("dry-run", false, "Show final image instead of pushing")
imagetools_createCmd.Flags().StringArrayP("file", "f", []string{}, "Read source descriptor from file")
imagetools_createCmd.Flags().String("progress", "auto", "Set type of progress output (\"auto\", \"plain\", \"tty\"). Use plain to show container output")
imagetools_createCmd.Flags().StringArrayP("tag", "t", []string{}, "Set reference for new image")
imagetoolsCmd.AddCommand(imagetools_createCmd)

carapace.Gen(imagetools_createCmd).FlagCompletion(carapace.ActionMap{
"file": carapace.ActionFiles(),
"file": carapace.ActionFiles(),
"progress": carapace.ActionValues("auto", "plain", "tty"),
})

// TODO verify positional completion - is this correct?
Expand Down
7 changes: 4 additions & 3 deletions completers/docker-buildx_completer/cmd/imagetools_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import (
)

var imagetools_inspectCmd = &cobra.Command{
Use: "inspect",
Short: "Show details of image in the registry",
Use: "inspect [OPTIONS] NAME",
Short: "Show details of an image in the registry",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(imagetools_inspectCmd).Standalone()
imagetools_inspectCmd.Flags().Bool("raw", false, "Show original JSON manifest")
imagetools_inspectCmd.Flags().String("format", "", "Format the output using the given Go template")
imagetools_inspectCmd.Flags().Bool("raw", false, "Show original, unformatted JSON manifest")
imagetoolsCmd.AddCommand(imagetools_inspectCmd)

// TODO verify positional completion - is this correct?
Expand Down
2 changes: 1 addition & 1 deletion completers/docker-buildx_completer/cmd/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var inspectCmd = &cobra.Command{
Use: "inspect",
Use: "inspect [NAME]",
Short: "Inspect current builder instance",
Run: func(cmd *cobra.Command, args []string) {},
}
Expand Down
2 changes: 1 addition & 1 deletion completers/docker-buildx_completer/cmd/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var pruneCmd = &cobra.Command{

func init() {
carapace.Gen(pruneCmd).Standalone()
pruneCmd.Flags().BoolP("all", "a", false, "Remove all unused images, not just dangling ones")
pruneCmd.Flags().BoolP("all", "a", false, "Include internal/frontend images")
pruneCmd.Flags().String("filter", "", "Provide filter values (e.g., \"until=24h\")")
pruneCmd.Flags().BoolP("force", "f", false, "Do not prompt for confirmation")
pruneCmd.Flags().String("keep-storage", "", "Amount of disk space to keep for cache")
Expand Down
2 changes: 1 addition & 1 deletion completers/docker-buildx_completer/cmd/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var rmCmd = &cobra.Command{
Use: "rm",
Use: "rm [NAME]",
Short: "Remove a builder instance",
Run: func(cmd *cobra.Command, args []string) {},
}
Expand Down
2 changes: 1 addition & 1 deletion completers/docker-buildx_completer/cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var stopCmd = &cobra.Command{
Use: "stop",
Use: "stop [NAME]",
Short: "Stop builder instance",
Run: func(cmd *cobra.Command, args []string) {},
}
Expand Down
2 changes: 1 addition & 1 deletion completers/docker-buildx_completer/cmd/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var useCmd = &cobra.Command{
Use: "use",
Use: "use [OPTIONS] NAME",
Short: "Set the current builder instance",
Run: func(cmd *cobra.Command, args []string) {},
}
Expand Down

0 comments on commit 48635f4

Please sign in to comment.