This is a creation in Article, where the information may have evolved or changed.
main.go
The code is as follows:
package mainimport ( _ "github.com/docker/docker/pkg/discovery/file" _ "github.com/docker/docker/pkg/discovery/kv" _ "github.com/docker/docker/pkg/discovery/nodes" _ "github.com/docker/swarm/discovery/token" "github.com/docker/swarm/cli")func main() { cli.Run()}
The following 4
line of code guarantees that package
the corresponding init
function can be executed:
_ "github.com/docker/docker/pkg/discovery/file"_ "github.com/docker/docker/pkg/discovery/kv"_ "github.com/docker/docker/pkg/discovery/nodes"_ "github.com/docker/swarm/discovery/token"
Only token
This package
is the swarm
new realization, the rest file
, kv
and nodes
all are docker
existing.
The
CLI package
uses GITHUB.COM/CODEGANGSTA/CLI this project
to build the CLI
program. Instead, the CLI. The run ()
function executes swarm
specific command
( create
, manage
, and so on).