Check that Docker is in Swarm mode
This commit updates deploy_stack.ps1 to check that Docker is running in
Swarm mode before proceeding.
if (Get-Command docker -errorAction SilentlyContinue)
{
-
+ docker node ls 2>&1 | out-null
+ if($?)
+ {
$user_secret = "basic-auth-user"
docker secret inspect $user_secret 2>&1 | out-null
if($?)
@@ -29,6 +31,12 @@ if (Get-Command docker -errorAction SilentlyContinue)
Write-Host "Deploying stack"
docker stack deploy func --compose-file ./docker-compose.yml
+
+ }
+ else
+ {
+ Write-Host "Docker not in swarm mode, please initialise the cluster (`docker swarm init`) and retry"
+ }
}
else
{
