mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Better error on 'docker deploy' when not in Swarm mode
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
3b7ea4d8c3
commit
aab92ec7ec
1 changed files with 8 additions and 0 deletions
|
@ -52,6 +52,14 @@ func runDeploy(dockerCli *client.DockerCli, opts deployOptions) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info, err := dockerCli.Client().Info(context.Background())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if !info.Swarm.ControlAvailable {
|
||||||
|
return fmt.Errorf("This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again.")
|
||||||
|
}
|
||||||
|
|
||||||
networks := getUniqueNetworkNames(bundle.Services)
|
networks := getUniqueNetworkNames(bundle.Services)
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue