项目作者: okvic77

项目描述 :
Digitalocean Terraform Docker swarm
高级语言: HCL
项目地址: git://github.com/okvic77/doswarm.git
创建时间: 2017-11-27T17:41:42Z
项目社区:https://github.com/okvic77/doswarm

开源协议:

下载


Docker swarm

Create a docker swarm on Digitalocean within minutes.

  1. # Run once, or to update Docker
  2. packer build -var 'packer_image=CHANGE/base' -var 'digitalOceanToken=XXX' packer.json
  3. # Run to initialize terraform
  4. terraform init
  5. # Run when required, to scale, upgrade or delete.
  6. terraform apply -var digitalocean_token=XXX -var packer_image=CHANGE/base

Docker images

  1. docker service create \
  2. --constraint 'node.role == manager' \
  3. --mount type=bind,source=/,destination=/rootfs,readonly=true \
  4. --mount type=bind,source=/var/run,destination=/var/run \
  5. --mount type=bind,source=/sys,destination=/sys,readonly=true \
  6. --mount type=bind,source=/var/lib/docker/,destination=/var/lib/docker,readonly=true \
  7. --mount type=bind,source=/dev/disk/,destination=/dev/disk,readonly=true \
  8. --publish=8080:8080 \
  9. --detach=true \
  10. --name=cadvisor \
  11. google/cadvisor:latest