diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2017-09-07 16:12:26 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2017-09-07 16:47:22 +0800 |
commit | a3b2c0933cce0febfe0b2bf6edf6a40870533606 (patch) | |
tree | d3ec01ea0a08d07bb05439939df5122639258bae /zte/sfc-driver/plugin-standalone/src/main/assembly/docker/docker-entrypoint.sh | |
parent | 0c7caf4a6b7995a8d743eeea8e6cb4c47f7bb313 (diff) |
Add Dockerfile of vfc-sfc-driver-zte
Change-Id: I7549d47699d6f8c1d134d6022c32234548e5c7c9
Issue-Id: VFC-311
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'zte/sfc-driver/plugin-standalone/src/main/assembly/docker/docker-entrypoint.sh')
-rwxr-xr-x | zte/sfc-driver/plugin-standalone/src/main/assembly/docker/docker-entrypoint.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/zte/sfc-driver/plugin-standalone/src/main/assembly/docker/docker-entrypoint.sh b/zte/sfc-driver/plugin-standalone/src/main/assembly/docker/docker-entrypoint.sh new file mode 100755 index 0000000..48f4ad3 --- /dev/null +++ b/zte/sfc-driver/plugin-standalone/src/main/assembly/docker/docker-entrypoint.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ -z "$SERVICE_IP" ]; then + export SERVICE_IP=`hostname -i` +fi +echo "SERVICE_IP=$SERVICE_IP" + + +if [ -z "$MSB_ADDR" ]; then + echo "Missing required variable MSB_ADDR: Microservices Service Bus address <ip>:<port>" + exit 1 +fi +echo "MSB_ADDR=$MSB_ADDR" + +# Wait for MSB initialization +echo "Wait for MSB initialization" +for i in {1..10}; do + curl -sS -m 1 $MSB_ADDR > /dev/null && break + sleep $i +done + +# Configure service based on docker environment variables +docker/instance_config.sh + +date > init.log + +# Start the microservice +docker/instance_run.sh |