Skip to content
Infrastructure provisioning, demo and presentation from our SUGCON 2018 talk "Painless deployments of Sitecore using Docker Swarm"
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

SUGCON 2018 "Painless deployments of Sitecore using Docker Swarm"

Thanks for stopping by! Here you can find everything to setup you own hybrid Docker Swarm cluster and try out everything we showed in our presentation and demos. If you have question or comments, reach out on the #Docker channel on or twitter: @pbering.


  1. Create a new Azure resource group.

  2. Create a Azure storage account in another resource group to store the Terraform state (OR remove the remote state config .\infrastructure\ and use local state instead).

  3. Review IP whitelist in .\infrastructure\network\

  4. Review resource group name, vm sizes and vm count in .\infrastructure\

  5. Change all prefix variables in .\infrastructure\

  6. Ensure you have a valid terraform.tfvars file with these variables:

    tenant_id = "***"
    subscription_id = "***"
    client_id = "***"
    client_secret = "***"
    admin_username = "***"
    admin_password = "***"
  7. Replace all occurrences of "" with your own Docker registry.

  8. Build and publish all images from .\images\**\Build.ps1.




Provision infrastructure

  • Switch dir to .\infrastructure.
  • Run:
    terraform init -backend-config='access_key=***'
    terraform plan
    terraform apply -auto-approve

Get IP addresses: az vm list-ip-addresses -g RESOURCE_GROUP_NAME -o table

Initialize build server

Install-Package Docker -ProviderName DockerProvider -RequiredVersion preview -Verbose -Force

docker image pull;docker image pull;docker image pull;docker image pull jetbrains/teamcity-server:2017.2.3-nanoserver-1709;docker image pull

mkdir c:\teamcity\server\data; mkdir c:\teamcity\server\logs; mkdir c:\teamcity\agent\conf

docker container run -d --name teamcity-server --restart=always -v c:\teamcity\server\data:C:/ProgramData/JetBrains/TeamCity -v c:\teamcity\server\logs:C:/TeamCity/logs -p 80:8111 jetbrains/teamcity-server:2017.2.3-nanoserver-1709

docker container run -d --name teamcity-agent --restart=always -e SERVER_URL="http://teamcity-server:8111" -e AGENT_NAME="build-agent" -v c:\teamcity\agent\conf:C:/BuildAgent/conf -v //./pipe/docker_engine://./pipe/docker_engine --link teamcity-server

The containers cannot currently be started using docker-compose as it does not yet understand mounting Windows named pipes (the -v //./pipe/docker_engine://./pipe/docker_engine argument).

Initialize Docker Swarm cluster

  • Linux: docker swarm init on the first one and join the rest as managers.
  • Windows: Join as workers.
  • Windows: Pull images docker image pull;docker image pull;docker image pull;docker image pull
sudo docker node update --label-add zone=a runtime-nixvm0
sudo docker node update --label-add data=yes runtime-nixvm1
sudo docker node update --label-add data=no runtime-winvm0
sudo docker node update --label-add data=yes runtime-winvm1
sudo docker node update --label-add data=no runtime-winvm2

sudo docker network create --driver overlay --opt www

sudo docker stack deploy --compose-file ./docker-compose.operations.yml operations
sudo docker stack deploy --compose-file ./docker-compose.metrics.yml metrics


Acquire new Let's Encrypt certificate from a manager node and add it as Docker Swarm secrets:

  1. sudo docker run -it --rm --name letsencrypt -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" certbot/certbot:latest certonly -d * --manual --preferred-challenges dns --server
  2. sudo docker secret create fullchain.pem /etc/letsencrypt/live/
  3. sudo docker secret create privkey.pem /etc/letsencrypt/live/


You can’t perform that action at this time.