This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new binary docker-app-standalone which is in fact the old docke…
…r-app before its pluginization. Added it to cross compilation Now each released tar.gz file per os comes with two binaries in it: docker-app-plugin-os and docker-app-standalone-os Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
- Loading branch information
1 parent
2452b40
commit 4697791
Showing
4 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/spf13/pflag" | ||
|
||
"github.com/docker/app/internal" | ||
app "github.com/docker/app/internal/commands" | ||
"github.com/docker/cli/cli" | ||
"github.com/docker/cli/cli/command" | ||
cliflags "github.com/docker/cli/cli/flags" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
func main() { | ||
dockerCli, err := command.NewDockerCli() | ||
if err != nil { | ||
fmt.Fprintln(os.Stderr, err) | ||
} | ||
logrus.SetOutput(dockerCli.Err()) | ||
|
||
cmd := app.NewRootCmd() | ||
configureRootCmd(cmd, dockerCli) | ||
|
||
if err := cmd.Execute(); err != nil { | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func configureRootCmd(cmd *cobra.Command, dockerCli *command.DockerCli) { | ||
var ( | ||
opts *cliflags.ClientOptions | ||
flags *pflag.FlagSet | ||
) | ||
|
||
cmd.Use = "docker-app" | ||
cmd.SilenceUsage = true | ||
cmd.TraverseChildren = true | ||
cmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error { | ||
opts.Common.SetDefaultOptions(flags) | ||
return dockerCli.Initialize(opts) | ||
} | ||
cmd.Version = fmt.Sprintf("%s, build %s", internal.Version, internal.GitCommit) | ||
|
||
opts, flags, _ = cli.SetupRootCommand(cmd) | ||
flags.BoolP("version", "v", false, "Print version information") | ||
cmd.SetVersionTemplate("docker-app version {{.Version}}\n") | ||
|
||
app.AddCommands(cmd, dockerCli) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters