Skip to content

Commit

Permalink
Merge pull request moby#25216 from aanand/deploy-error-when-not-in-sw…
Browse files Browse the repository at this point in the history
…arm-mode

Better error on 'docker deploy' when not in Swarm mode
  • Loading branch information
crosbymichael authored Aug 12, 2016
2 parents ccf3dd8 + aab92ec commit 2a10899
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/client/stack/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ func runDeploy(dockerCli *client.DockerCli, opts deployOptions) error {
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)
ctx := context.Background()

Expand Down

0 comments on commit 2a10899

Please sign in to comment.