File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ set -eo pipefail
99# set debug based on envvar
1010[[ $DEBUG ]] && set -x
1111
12+ # HACK: get the host IP address through the default gateway
13+ export HOST=$( netstat -nr | grep ' ^0\.0\.0\.0' | awk ' {print $2}' )
14+
1215# configure etcd
13- export ETCD=${ETCD:- 172.17.42.1: 4001}
16+ export ETCD_PORT=${ETCD_PORT:- 4001}
17+ export ETCD=" $HOST :$ETCD_PORT "
1418export ETCD_PATH=${ETCD_PATH:-/ deis/ builder}
1519export ETCD_TTL=${ETCD_TTL:- 10}
1620
@@ -67,11 +71,10 @@ trap on_exit INT TERM EXIT
6771
6872echo deis-builder running...
6973
70- # publish the service to etcd using the injected HOST and PORT
74+ # publish the service to etcd using the injected PORT
7175if [[ ! -z $PUBLISH ]]; then
7276
7377 # configure service discovery
74- HOST=${HOST:- localhost}
7578 PORT=${PORT:- 2222}
7679 PROTO=${PROTO:- tcp}
7780
Original file line number Diff line number Diff line change 11[Unit]
22Description =deis-builder
3- Requires =docker.service docker-tcp.socket etcd.service
4- After =docker.service etcd.service
53
64[Service]
7- ExecStart =/bin/bash -c '/usr/bin/docker start -a deis-builder || /usr/bin/docker run --name deis-builder -p 2222:22 -e PUBLISH=22 -e HOST=172.17.8.100 -e PORT=2222 -e ETCD=172.17.8.100:4001 --privileged deis/builder'
8- ExecStop =/usr/bin/docker stop deis-builder
5+ TimeoutStartSec =20m
6+ ExecStartPre =/usr/bin/docker pull deis/builder:latest
7+ ExecStart =/usr/bin/docker run --name deis-builder -p 2222:22 -e PUBLISH =22 -e PORT =2222 --privileged deis/builder
8+ ExecStop =/usr/bin/docker rm -f deis-builder
99
1010[Install]
1111WantedBy =multi-user.target
Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ set -eo pipefail
99# set debug based on envvar
1010[[ $DEBUG ]] && set -x
1111
12+ # HACK: get the host IP address through the default gateway
13+ export HOST=$( netstat -nr | grep ' ^0\.0\.0\.0' | awk ' {print $2}' )
14+
1215# configure etcd
13- export ETCD=${ETCD:- 172.17.42.1: 4001}
16+ export ETCD_PORT=${ETCD_PORT:- 4001}
17+ export ETCD=" $HOST :$ETCD_PORT "
1418export ETCD_PATH=${ETCD_PATH:-/ deis/ cache}
1519export ETCD_TTL=${ETCD_TTL:- 10}
1620
@@ -52,11 +56,10 @@ CONFD_PID=$!
5256
5357echo deis-cache running...
5458
55- # publish the service to etcd using the injected HOST and PORT
59+ # publish the service to etcd using the injected PORT
5660if [[ ! -z $PUBLISH ]]; then
5761
5862 # configure service discovery
59- HOST=${HOST:- localhost}
6063 PORT=${PORT:- 6379}
6164 PROTO=${PROTO:- tcp}
6265
Original file line number Diff line number Diff line change 11[Unit]
22Description =deis-cache
3- Requires =docker.service docker-tcp.socket etcd.service
4- After =docker.service etcd.service
53
64[Service]
7- ExecStart =/bin/bash -c '/usr/bin/docker start -a deis-cache || /usr/bin/docker run --name deis-cache -p 6379:6379 -e PUBLISH=6379 -e HOST=172.17.8.100 -e ETCD=172.17.8.100:4001 deis/cache'
8- ExecStop =/usr/bin/docker stop deis-cache
5+ TimeoutStartSec =20m
6+ ExecStartPre =/usr/bin/docker pull deis/cache:latest
7+ ExecStart =/usr/bin/docker run --name deis-cache -p 6379:6379 -e PUBLISH =6379 deis/cache
8+ ExecStop =/usr/bin/docker rm -f deis-cache
99
1010[Install]
1111WantedBy =multi-user.target
Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ set -eo pipefail
99# set debug based on envvar
1010[[ $DEBUG ]] && set -x
1111
12+ # HACK: get the host IP address through the default gateway
13+ export HOST=$( netstat -nr | grep ' ^0\.0\.0\.0' | awk ' {print $2}' )
14+
1215# configure etcd
13- export ETCD=${ETCD:- 172.17.42.1: 4001}
16+ export ETCD_PORT=${ETCD_PORT:- 4001}
17+ export ETCD=" $HOST :$ETCD_PORT "
1418export ETCD_PATH=${ETCD_PATH:-/ deis/ controller}
1519export ETCD_TTL=${ETCD_TTL:- 10}
1620
@@ -69,11 +73,10 @@ CONFD_PID=$!
6973
7074echo deis-controller running...
7175
72- # publish the service to etcd using the injected HOST and PORT
76+ # publish the service to etcd using the injected PORT
7377if [[ ! -z $PUBLISH ]]; then
7478
7579 # configure service discovery
76- HOST=${HOST:- localhost}
7780 PORT=${PORT:- 8000}
7881 PROTO=${PROTO:- tcp}
7982
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ def attach(self, name):
199199
200200[Service]
201201ExecStartPre=/usr/bin/docker pull {image}
202- ExecStart=-/usr/bin/docker run --name {name} -P -e PORT={port} -e ETCD=172.17.42.1:4001 {image} {command}
202+ ExecStart=-/usr/bin/docker run --name {name} -P -e PORT={port} {image} {command}
203203ExecStop=-/usr/bin/docker rm -f {name}
204204"""
205205
@@ -238,7 +238,7 @@ def attach(self, name):
238238
239239[Service]
240240ExecStartPre=/usr/bin/docker pull {image}
241- ExecStart=-/usr/bin/docker run --name {name} -p 80:80 -p 443:443 -e ETCD=172.17.42.1:4001 {image} {command}
241+ ExecStart=-/usr/bin/docker run --name {name} -p 80:80 -p 443:443 {image} {command}
242242ExecStop=-/usr/bin/docker rm -f {name}
243243TimeoutStartSec=10min
244244"""
@@ -251,6 +251,6 @@ def attach(self, name):
251251
252252[Service]
253253ExecStartPre=/usr/bin/docker pull {image}
254- ExecStart=-/usr/bin/docker run --name {name} -p 514:514 -e HOST=%H -e PORT=514 -e ETCD=172.17.42.1:4001 {image} {command}
254+ ExecStart=-/usr/bin/docker run --name {name} -p 514:514 -e PORT=514 {image} {command}
255255ExecStop=-/usr/bin/docker rm -f {name}
256256"""
Original file line number Diff line number Diff line change 11[Unit]
22Description =deis-controller
3- Requires =docker.service docker-tcp.socket etcd.service deis-builder.service
4- After =docker.service etcd.service deis-builder.service
53
64[Service]
7- ExecStart =/bin/bash -c '/usr/bin/docker start -a deis-controller || /usr/bin/docker run --name deis-controller -p 8000:8000 -e PUBLISH=8000 -e HOST=172.17.8.100 -e ETCD=172.17.8.100:4001 deis/controller'
8- ExecStop =/usr/bin/docker stop deis-controller
5+ TimeoutStartSec =20m
6+ ExecStartPre =/usr/bin/docker pull deis/controller:latest
7+ ExecStart =/usr/bin/docker run --name deis-controller -p 8000:8000 -e PUBLISH =8000 deis/controller
8+ ExecStop =/usr/bin/docker rm -f deis-controller
99
1010[Install]
1111WantedBy =multi-user.target
Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ set -eo pipefail
99# set debug based on envvar
1010[[ $DEBUG ]] && set -x
1111
12+ # HACK: get the host IP address through the default gateway
13+ export HOST=$( netstat -nr | grep ' ^0\.0\.0\.0' | awk ' {print $2}' )
14+
1215# configure etcd
13- export ETCD=${ETCD:- 172.17.42.1: 4001}
16+ export ETCD_PORT=${ETCD_PORT:- 4001}
17+ export ETCD=" $HOST :$ETCD_PORT "
1418export ETCD_PATH=${ETCD_PATH:-/ deis/ database}
1519export ETCD_TTL=${ETCD_TTL:- 10}
1620
Original file line number Diff line number Diff line change 11[Unit]
22Description =deis-database
3- Requires =docker.service docker-tcp.socket etcd.service
4- After =docker.service etcd.service
53
64[Service]
7- ExecStart =/bin/bash -c '/usr/bin/docker start -a deis-database || /usr/bin/docker run --name deis-database -p 5432:5432 -e PUBLISH=5432 -e HOST=172.17.8.100 -e ETCD=172.17.8.100:4001 deis/database'
8- ExecStop =/usr/bin/docker stop deis-database
5+ TimeoutStartSec =20m
6+ ExecStartPre =/usr/bin/docker pull deis/database:latest
7+ ExecStart =/usr/bin/docker run --name deis-database -p 5432:5432 -e PUBLISH =5432 deis/database
8+ ExecStop =/usr/bin/docker rm -f deis-database
99
1010[Install]
1111WantedBy =multi-user.target
Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ set -eo pipefail
99# set debug based on envvar
1010[[ $DEBUG ]] && set -x
1111
12+ # HACK: get the host IP address through the default gateway
13+ export HOST=$( netstat -nr | grep ' ^0\.0\.0\.0' | awk ' {print $2}' )
14+
1215# configure etcd
13- export ETCD=${ETCD:- 172.17.42.1: 4001}
16+ export ETCD_PORT=${ETCD_PORT:- 4001}
17+ export ETCD=" $HOST :$ETCD_PORT "
1418export ETCD_PATH=${ETCD_PATH:-/ deis/ logs}
1519export ETCD_TTL=${ETCD_TTL:- 10}
1620
@@ -54,11 +58,10 @@ CONFD_PID=$!
5458
5559echo deis-logger running...
5660
57- # publish the service to etcd using the injected HOST and PORT
61+ # publish the service to etcd using the injected PORT
5862if [[ ! -z $PUBLISH ]]; then
5963
6064 # configure service discovery
61- HOST=${HOST:- localhost}
6265 PORT=${PORT:- 514}
6366 PROTO=${PROTO:- tcp}
6467
You can’t perform that action at this time.
0 commit comments