├── .gitignore ├── README.md ├── Vagrantfile ├── config.yml ├── dtr └── demo.sh ├── helper.sh ├── img ├── controller-addlicense.png ├── controller-editprofile.png ├── docker-datacenter.jpg ├── registry-addlicense.png ├── registry-adduser.png ├── registry-editdomain.png ├── registry-ignorewarning.png └── ucp-dashboard.png ├── logs └── .keep ├── start_dtr ├── start_ucp └── ucp ├── application └── docker-compose.yml └── bundle └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant/ 2 | ucp/bundle/* 3 | !ucp/bundle/.keep 4 | logs/* 5 | !logs/.keep 6 | *.lic -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # frntn/docker-datacenter-helper 2 | 3 | **Get Docker's official datacenter solutions _up & running_ in no time.** 4 | **100% _unattended_ installation !** 5 | 6 | Docker Datacenter solution is made of two commercial products : 7 | 8 | * `DTR` or `Docker Trusted Registry`: offers on-premise image management and storage 9 | * `UCP` or `Universal Control Plane`: offers on-premise docker applications management 10 | 11 | Both requires a CS subscription _(**C**ommercial **S**upport)_ 12 | 13 | You can get a free 30-days trial here : https://hub.docker.com/enterprise/trial 14 | 15 | ## Table of Contents 16 | 17 | - [Usage](#usage) 18 | - [A. Docker Trusted Registry](#a-docker-trusted-registry) 19 | - [A1. Start your DTR](#a1-start-your-dtr) 20 | - [A2. DTR asciicast](#a2-dtr-asciicast) 21 | - [B. Universal Control Plane](#b-universal-control-plane) 22 | - [B1. Start your UCP cluster](#b1-start-your-ucp-cluster) 23 | - [B2. UCP asciicast](#b2-ucp-asciicast) 24 | - [B3. Launch demo](#b3-launch-demo) 25 | - [Miscellaneous](#miscellaneous) 26 | 27 | ## Usage 28 | 29 | **Pre-requisite:** 30 | 31 | On my laptop, my network interface is either `eth0` (cable) or `wlan0` (wifi). 32 | You should check the `config.vm.network` parameter in the `Vagrantfile` 33 | if it reflects your setup. If not update it accordingly. 34 | 35 | On linux you can extract that information with this simple command : 36 | `ip -o -4 route get 8.8.8.8 | cut -f5 -d' '` 37 | 38 | ### A. Docker Trusted Registry 39 | 40 | #### A1. start your DTR 41 | 42 | Drop your `docker_subscription.lic` license file at the root of the project, then start your DTR instance(s) : 43 | 44 | ```bash 45 | ./start_dtr 46 | ``` 47 | 48 | This will _provision_ and _configure_ the DTR nodes defined in [config.yml](config.yml) file 49 | 50 | The script will automate all the install process (including license upload). 51 | You'll endup with a full functionnal and ready to use private registry. 52 | 53 | Upon completion, URL to your registry dashboard will be echoed to stdout. 54 | 55 | #### A2. DTR Asciicast 56 | 57 | Below is an asciicast capturing the `start_dtr` script output with the default settings : 58 | 59 | [![dtr-asciicast-stdout](https://asciinema.org/a/cqwsraz40gcgscka3gguqfvz0.png)](https://asciinema.org/a/cqwsraz40gcgscka3gguqfvz0?autoplay=1) 60 | 61 | And here is an asciicast capturing the log file content for that same `start_dtr` exec : 62 | 63 | [![dtr-asciicast-logfile](https://asciinema.org/a/ccor16nadmss9hn76v1tq6fes.png)](https://asciinema.org/a/ccor16nadmss9hn76v1tq6fes?autoplay=1&speed=2) 64 | 65 | ### B. Universal Control Plane 66 | 67 | #### B1. start your UCP cluster 68 | 69 | Drop your `docker_subscription.lic` license file at the root of the project, then start your DTR instance(s) : 70 | 71 | ```bash 72 | ./start_ucp 73 | ``` 74 | 75 | This will _provision_ and _configure_ the UCP cluster nodes defined in [config.yml](config.yml) file 76 | 77 | The script will automate all the install process (including license upload). 78 | You'll endup with a full functionnal and ready to use universal docker platform. 79 | 80 | Upon completion, URL(s) to your controller(s) dashboard(s) will be echoed to stdout. 81 | 82 | #### B2. UCP Asciicast 83 | 84 | Below is an asciicast capturing the `start_ucp` script output with the default settings : 85 | 86 | [![ucp-asciicast-stdout](https://asciinema.org/a/8uogw0mfmgvpaeqqc7ezgsi9t.png)](https://asciinema.org/a/8uogw0mfmgvpaeqqc7ezgsi9t?autoplay=1) 87 | 88 | And here is an asciicast capturing the log file content for that same `start_ucp` exec : 89 | 90 | [![ucp-asciicast-logfile](https://asciinema.org/a/22g7wcaswtioe3is4twgy7ff6.png)](https://asciinema.org/a/22g7wcaswtioe3is4twgy7ff6?autoplay=1&speed=2) 91 | 92 | #### B3. launch demo 93 | 94 | To use the demo application, we want our local docker client to point to this newly created UCP cluster : 95 | 96 | ```bash 97 | # before check 98 | docker version # <-- the 'Server' section mentions 'Version: x.y.z' 99 | 100 | # load environment variable so your docker client points to remote docker server 101 | cd ucp/bundle/ 102 | source env.sh # <-- your docker client now speaks with your "remote" UCP cluster 103 | 104 | # after check 105 | docker version # <-- the 'Server' now mentions 'Version: ucp/x.y.z' 106 | ``` 107 | 108 | Then we can now spin up the demo application : 109 | 110 | ```bash 111 | cd ucp/application 112 | docker-compose up -d 113 | ``` 114 | 115 | Back to the UCP dashboard you can see the newly deployed application : 116 | 117 | ![registry-adduser](img/ucp-dashboard.png?raw=true) 118 | 119 | **Congratulations : you've just created your very fist application on an UCP cluster ! :)** 120 | 121 | ## Miscellaneous 122 | 123 | * Docker Trusted Registry [official product page](https://www.docker.com/products/docker-trusted-registry) and [solution brief](https://www.docker.com/sites/default/files/Solutions_Brief_Docker%20Trusted%20Registry_V2%20%281%29.pdf) 124 | * Docker Universal Control Plane [official product page](https://www.docker.com/products/docker-universal-control-plane) and [solution brief](https://www.docker.com/sites/default/files/Solutions_UCP_V3.pdf) 125 | 126 | ![official-logo](img/docker-datacenter.jpg?raw=true) 127 | 128 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | require 'yaml' 5 | 6 | settings = YAML::load(File.read(File.dirname(__FILE__) + "/config.yml")) 7 | 8 | # UCP nodes 9 | if settings['ucp'].include?('nodes') 10 | nodes=settings['ucp']['nodes'] 11 | ucp_controllers = [] 12 | ucp_endpoints = [] 13 | nodes.each { |node| 14 | if node.include?('type') && node['type'] == 'controller' 15 | ucp_controllers.push(node['name']) 16 | else 17 | ucp_endpoints.push(node['name']) 18 | end 19 | } 20 | end 21 | ucp_main_controller = [ucp_controllers.shift] 22 | ucp_replica_controllers = ucp_controllers 23 | 24 | # DTR nodes 25 | if settings['dtr'].include?('nodes') 26 | nodes=settings['dtr']['nodes'] 27 | dtr_registries = [] 28 | nodes.each { |node| dtr_registries.push(node['name']) } 29 | end 30 | 31 | 32 | $UCP_INSTALL = <" | awk '{print $2}' | cut -d'/' -f1) 34 | docker run --rm --name ucp -v /var/run/docker.sock:/var/run/docker.sock docker/ucp install --host-address $ip --san ${HOSTNAME}.docker.local --san "*.tcp.ngrok.io" 35 | UCP 36 | 37 | $NGROK_INSTALL = <" | awk '{print $2}' | cut -d'/' -f1) 47 | iptables -t nat -I PREROUTING -p tcp -d $ip/32 --dport 4040 -j DNAT --to-destination 127.0.0.1:4040 48 | NGROK 49 | 50 | $GITLABCI_INSTALL= "true" 51 | if settings.include?('gitlabci') && settings['gitlabci'].include?('token') 52 | ci_token = settings['gitlabci']['token'] 53 | ci_url = settings['gitlabci'].include?('url') ? settings['gitlabci']['url'] : 'https://gitlab.com/ci' 54 | ci_runner = settings['gitlabci'].include?('name') ? settings['gitlabci']['name'] : 'UCP Runner' 55 | ci_tags = settings['gitlabci'].include?('tags') ? settings['gitlabci']['tags'] : %w( docker ucp ) 56 | $GITLABCI_INSTALL = < plugins 30 | 31 | cat <Dockerfile 32 | FROM jenkins:1.625.3 33 | 34 | #New plugins must be placed in the plugins file 35 | COPY plugins /usr/share/jenkins/plugins 36 | 37 | #The plugins.sh script will install new plugins 38 | RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins 39 | 40 | #Copy private key and cert to image 41 | #COPY https.crt /var/lib/jenkins/https.crt 42 | #COPY https.key /var/lib/jenkins/https.key 43 | 44 | #Configure HTTP off and HTTPS on, using port 8443 45 | #ENV JENKINS_OPTS --httpPort=-1 --httpsPort=8443 --httpsCertificate=/var/lib/jenkins/https.crt --httpsPrivateKey=/var/lib/jenkins/https.key 46 | ENV JENKINS_OPTS --httpPort=8080 47 | EOF 48 | 49 | docker build -t "$DTR_URL/$DTR_ORG/$DTR_REPO" . 50 | docker login -e "$DTR_EMAIL" -u "$DTR_USER" -p "$DTR_PASS" "$DTR_URL" 51 | sleep 1 # without we may have the following error : "dial tcp 127.0.1.1:443: connection refused" 52 | 53 | # test the push 54 | docker push "$DTR_URL/$DTR_ORG/$DTR_REPO" 55 | 56 | # test the pull 57 | docker rmi "$DTR_URL/$DTR_ORG/$DTR_REPO" 58 | docker pull "$DTR_URL/$DTR_ORG/$DTR_REPO" 59 | 60 | # start the container 61 | # (note: this setup is for demo purpose. IRL you should enable https and use volume for data to persist...) 62 | sudo mkdir -p /var/lib/jenkins 63 | sudo chown $USER:${GROUPS[0]} /var/lib/jenkins 64 | docker rm $(docker kill jenkins01) 65 | docker run -p 8080:8080 -p 50000:50000 -v /var/lib/jenkins:/var/jenkins_home -d --name jenkins01 "$DTR_URL/$DTR_ORG/$DTR_REPO" 66 | 67 | jen=$(ip addr show dev eth1 | grep -E '\' | awk '{print $2}' | cut -d'/' -f1) 68 | { 69 | echo 70 | echo "Jenkins dashboard => http://$jen:8080" 71 | echo 72 | } >&2 73 | 74 | : <organisation) 84 | - "myjenkins" repo (dashboard->organisation->"ci-infra"->new repo) 85 | 86 | HELP 87 | -------------------------------------------------------------------------------- /helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | { 4 | set -u 5 | 6 | function get_ip { 7 | node=${1:-"controller"} 8 | vagrant ssh $node -c \ 9 | 'ip addr show dev eth1' \ 10 | 2>/dev/null \ 11 | | grep -E '\' \ 12 | | awk '{print $2}' \ 13 | | cut -d'/' -f1 14 | } 15 | 16 | function create_snapshot { 17 | echo "==> Create ${action^^} snapshots ($func)" 18 | for node in $snapshot_nodes 19 | do 20 | vagrant snapshot save "$node" "$func" 21 | done >> $logf 22 | } 23 | 24 | function dtr_provision { 25 | # Destroy previous if asked 26 | if [ "$DTR_PURGE" = true ] 27 | then 28 | vagrant destroy $DTR_NODES -f 29 | fi 30 | 31 | # Start all DTR nodes 32 | vagrant up $DTR_NODES 33 | 34 | echo; echo "---------- END VAGRANT PROVISIONING ----------"; echo 35 | } 36 | 37 | function dtr_configure { 38 | for node in $DTR_NODES 39 | do 40 | curlopts="-sSLk -X PUT" 41 | curlhead="Content-Type: application/json;charset=UTF-8" 42 | 43 | echo "==> $node: Setup domain name" 44 | dtr_ip=$(get_ip $node) 45 | dtr_settings='{"loadBalancerHTTPPort":80,"loadBalancerHTTPSPort":443,"domainName":"'$node'.docker.local","notaryServer":"","notaryCert":"","notaryVerifyCert":false,"authBypassCA":"","authBypassOU":"","httpProxy":"","httpsProxy":"","noProxy":"","disableUpgrades":false,"releaseChannel":""}' 46 | curl $curlopts -H "$curlhead" -d "$dtr_settings" https://$dtr_ip/api/v0/admin/settings/http | awk '{print " '$node': "$0}' 47 | 48 | sleep 30 # <-- wait for the service to restart (https cert update) 49 | 50 | echo "==> $node: Upload license" 51 | curl $curlopts -H "$curlhead" -d @<(jq -c '.' $DTR_LICENSE) https://$dtr_ip/api/v0/admin/settings/license | awk '{print " '$node': "$0}' 52 | 53 | echo "==> $node: Add admin account" 54 | dtr_admin='{"method":"managed","managed":{"users":[{"username":"'$DTR_USER'","password":"'$DTR_PASS'","isNew":true,"isAdmin":true,"isReadWrite":false,"isReadOnly":false,"teamsChanged":true}]}}' 55 | curl $curlopts -H "$curlhead" -d "$dtr_admin" https://$dtr_ip/api/v0/admin/settings/auth | awk '{print " '$node': "$0}' 56 | done 57 | 58 | echo; echo "---------- END DTR CONFIGURATION ----------"; echo 59 | } 60 | 61 | function start_dtr_demo { 62 | vagrant ssh $DTR_NODES -c /vagrant/dtr/demo.sh 63 | } 64 | 65 | function ucp_provision { 66 | # Destroy previous if asked 67 | if [ "$UCP_PURGE" = true ] 68 | then 69 | vagrant destroy $UCP_NODES -f 70 | fi 71 | 72 | # Start all UCP nodes 73 | vagrant up $UCP_NODES 74 | 75 | echo; echo "---------- END VAGRANT PROVISIONING ----------"; echo 76 | } 77 | 78 | function ucp_configure { 79 | 80 | echo "==> Get authorization token" 81 | ucp_main_controller_ip=$(get_ip $UCP_MAIN_CONTROLLER) 82 | authorization=$( 83 | curl -sSLk -X POST \ 84 | -d @<(echo '{"username":"'${UCP_USER}'","password":"'${UCP_PASS}'"}') \ 85 | --header "Content-Type: application/json;charset=UTF-8" \ 86 | "https://$ucp_main_controller_ip/auth/login" | jq -r '.auth_token' 87 | ) 88 | 89 | echo "==> Upload license" 90 | echo '{"license_config":'$(jq -c '.' $UCP_LICENSE)',"auto_refresh": true}' > mylicense.lic 91 | curl -sSLk -X POST \ 92 | -d @mylicense.lic \ 93 | --header "Content-Type: application/json;charset=UTF-8" \ 94 | --header "Authorization: Bearer $authorization" \ 95 | "https://$ucp_main_controller_ip/api/config/license" 96 | 97 | main="$UCP_MAIN_CONTROLLER" 98 | ipucp=$(vagrant ssh $main -c "ip addr show dev eth1" 2>/dev/null | grep -E '\' | awk '{print $2}' | cut -d'/' -f1) 99 | fingerprint="$(openssl s_client -connect "${ipucp}:443" /dev/null | openssl x509 -fingerprint -noout | cut -d'=' -f2)" 100 | 101 | echo "==> Join replica nodes to main cluster controller ($main)" 102 | replica="--replica" 103 | for node in $UCP_REPLICA_CONTROLLERS 104 | do 105 | #vagrant up $node 106 | ipnode=$(vagrant ssh $node -c "ip addr show dev eth1" 2>/dev/null | grep -E '\' | awk '{print $2}' | cut -d'/' -f1) 107 | vagrant ssh $node -c " 108 | docker run \ 109 | --rm \ 110 | --tty \ 111 | --name ucp \ 112 | --interactive \ 113 | -e UCP_ADMIN_USER=$UCP_USER \ 114 | -e UCP_ADMIN_PASSWORD=$UCP_PASS \ 115 | -v /var/run/docker.sock:/var/run/docker.sock \ 116 | \ 117 | docker/ucp join \ 118 | --san ${node}.docker.local \ 119 | --host-address $ipnode \ 120 | --url https://$ipucp \ 121 | --fingerprint $fingerprint \ 122 | --fresh-install \ 123 | $replica 124 | " 2>/dev/null | awk '{print " '$node': "$0}' 125 | done 126 | 127 | echo "==> Join standard nodes to cluster ($main)" 128 | replica="" 129 | for node in $UCP_ENDPOINTS 130 | do 131 | #vagrant up $node 132 | ipnode=$(vagrant ssh $node -c "ip addr show dev eth1" 2>/dev/null | grep -E '\' | awk '{print $2}' | cut -d'/' -f1) 133 | vagrant ssh $node -c " 134 | docker run \ 135 | --rm \ 136 | --tty \ 137 | --name ucp \ 138 | --interactive \ 139 | -e UCP_ADMIN_USER=$UCP_USER \ 140 | -e UCP_ADMIN_PASSWORD=$UCP_PASS \ 141 | -v /var/run/docker.sock:/var/run/docker.sock \ 142 | \ 143 | docker/ucp join \ 144 | --san ${node}.docker.local \ 145 | --host-address $ipnode \ 146 | --url https://$ipucp \ 147 | --fingerprint $fingerprint \ 148 | --fresh-install \ 149 | $replica 150 | " 2>/dev/null | awk '{print " '$node': "$0}' 151 | done 152 | 153 | # overlay networks require access to a key-value store 154 | echo "==> Add Multi-Host Networking Support to Docker Daemons" 155 | for node in $UCP_NODES 156 | do 157 | vagrant ssh $node -c " 158 | ip=\$(ip addr show dev eth1 | grep -E '\\' | awk '{print \$2}' | cut -d'/' -f1) 159 | { 160 | echo 'DOCKER_OPTS=\"\$DOCKER_OPTS --cluster-advertise '\$ip':12376\"' 161 | echo 'DOCKER_OPTS=\"\$DOCKER_OPTS --cluster-store etcd://$ipucp:12379\"' 162 | echo 'DOCKER_OPTS=\"\$DOCKER_OPTS --cluster-store-opt kv.cacertfile=/var/lib/docker/discovery_certs/ca.pem\"' 163 | echo 'DOCKER_OPTS=\"\$DOCKER_OPTS --cluster-store-opt kv.certfile=/var/lib/docker/discovery_certs/cert.pem\"' 164 | echo 'DOCKER_OPTS=\"\$DOCKER_OPTS --cluster-store-opt kv.keyfile=/var/lib/docker/discovery_certs/key.pem\"' 165 | } | sudo tee -a /etc/default/docker 166 | sudo service docker restart 167 | " 2>/dev/null | awk '{print " '$node': "$0}' 168 | done 169 | 170 | # wait for all docker engines to restart and sync with 171 | # their new multi-host networking setup (can take some time...) 172 | sleep 240 173 | 174 | echo "==> Download Client Bundle" 175 | cd ucp/bundle 176 | AUTHTOKEN=$(curl -sk -d "{\"username\":\"$UCP_USER\",\"password\":\"$UCP_PASS\"}" https://$ipucp/auth/login | jq -r .auth_token) 177 | curl -sSLk -H "Authorization: Bearer $AUTHTOKEN" https://$ipucp/api/clientbundle -o bundle.zip 178 | 179 | echo "==> Extract Client Bundle" 180 | unzip -o bundle.zip | awk '{print " "$0}' 181 | rm bundle.zip 182 | 183 | echo "==> Load Client Bundle" 184 | source env.sh 185 | 186 | echo; echo "---------- END UCP CONFIGURATION ----------"; echo 187 | 188 | echo "==> Check docker version ('Version: ucp/x.x.x' expected for 'Server:' section)" 189 | docker version | sed -n '1,2p;9,10p' | awk '{print " "$0}' 190 | 191 | echo "==> Show Nodes and Cluster Managers count" 192 | docker info | grep -E "^Nodes:|^Cluster Managers:" | awk '{print " "$0}' 193 | } 194 | 195 | # === BEGIN =================================================================== 196 | 197 | : ${DTR_PURGE:=false} 198 | : ${DTR_LICENSE:="docker_subscription.lic"} 199 | : ${DTR_REGISTRIES:="registry"} 200 | : ${DTR_USER:="frntn"} 201 | : ${DTR_PASS:="demopass"} 202 | 203 | : ${UCP_PURGE:=false} 204 | : ${UCP_LICENSE:="docker_subscription.lic"} 205 | : ${UCP_MAIN_CONTROLLER:="controller1"} 206 | : ${UCP_REPLICA_CONTROLLERS:=""} 207 | : ${UCP_ENDPOINTS:="client1 client2"} 208 | 209 | DTR_NODES="$DTR_REGISTRIES" 210 | UCP_NODES="$UCP_MAIN_CONTROLLER $UCP_REPLICA_CONTROLLERS $UCP_ENDPOINTS" 211 | UCP_USER="admin" 212 | UCP_PASS="orca" 213 | 214 | projectroot="$(dirname "$0")" 215 | 216 | # DISPATCHER 217 | action="${1,,}" 218 | case "$action" in 219 | 'ucp') 220 | snapshot_nodes="$UCP_NODES" 221 | dashboard_nodes="$UCP_MAIN_CONTROLLER $UCP_REPLICA_CONTROLLERS" 222 | user="$UCP_USER" 223 | pass="$UCP_PASS" 224 | ;; 225 | 'dtr') 226 | main="start_$action" 227 | snapshot_nodes="$DTR_NODES" 228 | dashboard_nodes="$DTR_NODES" 229 | user="$DTR_USER" 230 | pass="$DTR_PASS" 231 | ;; 232 | *) 233 | echo >&2 "$0: FATAL: unknown action '$action'" 234 | exit 255 235 | ;; 236 | esac 237 | 238 | # LOFGILE 239 | logdate="$(date +%Y%m%d_%H%M)" 240 | logf="logs/${action}_${logdate}.log" 241 | echo; echo "Log file is '$logf'"; echo 242 | logf="$projectroot/$logf" 243 | 244 | # PROVISION 245 | echo "==> Provision ${action^^} nodes" 246 | cd "$projectroot" 247 | func="${action}_provision" 248 | $func >> $logf 249 | create_snapshot 250 | 251 | # CONFIGURE 252 | echo "==> Configure ${action^^} nodes" 253 | cd "$projectroot" 254 | func="${action}_configure" 255 | $func >> $logf 256 | create_snapshot 257 | 258 | # DASHBOARDS 259 | echo 260 | echo "=========================================" 261 | echo "= User: $user" 262 | echo "= Pass: $pass" 263 | echo "= ---------------------------------------" 264 | echo "= Dashboard URL(s):" 265 | echo "=" 266 | for node in $dashboard_nodes 267 | do 268 | echo -e "= $node\thttps://$(get_ip $node)/" 269 | done 270 | echo "=========================================" 271 | echo 272 | 273 | } 274 | -------------------------------------------------------------------------------- /img/controller-addlicense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/controller-addlicense.png -------------------------------------------------------------------------------- /img/controller-editprofile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/controller-editprofile.png -------------------------------------------------------------------------------- /img/docker-datacenter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/docker-datacenter.jpg -------------------------------------------------------------------------------- /img/registry-addlicense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/registry-addlicense.png -------------------------------------------------------------------------------- /img/registry-adduser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/registry-adduser.png -------------------------------------------------------------------------------- /img/registry-editdomain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/registry-editdomain.png -------------------------------------------------------------------------------- /img/registry-ignorewarning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/registry-ignorewarning.png -------------------------------------------------------------------------------- /img/ucp-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/img/ucp-dashboard.png -------------------------------------------------------------------------------- /logs/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/logs/.keep -------------------------------------------------------------------------------- /start_dtr: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'yaml' 4 | 5 | boxes = YAML::load(File.read(File.dirname(__FILE__) + "/config.yml")) 6 | 7 | # UCP nodes 8 | if boxes['dtr'].include?('nodes') 9 | 10 | dtr_registries = [] 11 | 12 | nodes=boxes['dtr']['nodes'] 13 | nodes.each { |node| 14 | dtr_registries.push(node['name']) 15 | } 16 | 17 | system( 18 | { 19 | "DTR_REGISTRIES" => "#{dtr_registries.flatten.join(' ')}", 20 | }, 21 | "./helper.sh dtr" 22 | ) 23 | 24 | end -------------------------------------------------------------------------------- /start_ucp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'yaml' 4 | 5 | boxes = YAML::load(File.read(File.dirname(__FILE__) + "/config.yml")) 6 | 7 | # UCP nodes 8 | if boxes['ucp'].include?('nodes') 9 | 10 | ucp_controllers = [] 11 | ucp_endpoints = [] 12 | 13 | nodes=boxes['ucp']['nodes'] 14 | nodes.each { |node| 15 | if node.include?('type') && node['type'] == 'controller' 16 | ucp_controllers.push(node['name']) 17 | else 18 | ucp_endpoints.push(node['name']) 19 | end 20 | } 21 | 22 | ucp_main_controller = [ucp_controllers.shift] 23 | ucp_replica_controllers = ucp_controllers 24 | 25 | system( 26 | { 27 | "UCP_MAIN_CONTROLLER" => "#{ucp_main_controller.flatten.join(' ')}", 28 | "UCP_REPLICA_CONTROLLERS" => "#{ucp_replica_controllers.flatten.join(' ')}", 29 | "UCP_ENDPOINTS" => "#{ucp_endpoints.flatten.join(' ')}", 30 | }, 31 | "./helper.sh ucp" 32 | ) 33 | 34 | end -------------------------------------------------------------------------------- /ucp/application/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | voting-app: 5 | image: dockercond2/dockercon-voting-app 6 | ports: 7 | - "5000:80" 8 | 9 | redis: 10 | image: redis 11 | ports: ["6379"] 12 | 13 | worker: 14 | image: dockercond2/dockercon-worker 15 | 16 | db: 17 | image: postgres:9.4 18 | 19 | result-app: 20 | image: dockercond2/dockercon-result-app 21 | ports: 22 | - "5001:80" 23 | 24 | -------------------------------------------------------------------------------- /ucp/bundle/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frntn/docker-datacenter-helper/f680d2cb7807609a68ab75514810f09937d16545/ucp/bundle/.keep --------------------------------------------------------------------------------