-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.ps1
38 lines (32 loc) · 918 Bytes
/
run.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$env:DOCKER_HOST="vdc-qasapptst01"
docker stop consul-agent
docker rm consul-agent
$hostname = $env:DOCKER_HOST.ToUpper()
$fqdn=[System.Net.Dns]::GetHostByName($env:DOCKER_HOST) | FL HostName | Out-String | %{ "{0}" -f $_.Split(':')[1].Trim() }
write-host $fqdn
write-host $hostname
$consul = [System.Net.Dns]::GetHostAddresses($fqdn)
write-host $consul
$ip='10.100.63.83'
$ip
$consul = "10.100.63.177"
$consul
$domain='STORMWIND-LOCAL'
docker run -d --restart=always `
-p 8300:8300 `
-p 8301:8301/tcp -p 8301:8301/udp -p 8302:8302/tcp -p 8302:8302/udp -p 8400:8400 -p 8500:8500 -p 53:53/udp `
-h $hostname `
--name consul-agent `
-e CONSUL=$consul `
-e IP=$ip `
-e DATACENTER=$domain `
-v c:/consul:c:/consul `
spring2/consul `
agent -join $consul `
-advertise $ip `
-datacenter $domain `
-config-file /consul/config/consul.json `
-data-dir /consul/data `
-client 0.0.0.0 `
-ui `
-dns-port=53