From 1fa5a04f35643f82133a7b5d7debc50425c448c0 Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Tue, 19 Mar 2019 18:04:35 +0000 Subject: [PATCH] [docker script] skip docker mount point checking for database container database container doesn't mount hwsku folder. Signed-off-by: Ying Xie --- files/build_templates/docker_image_ctl.j2 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 1676e4624a8e..c2d227b43522 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -103,9 +103,17 @@ start() { DOCKERCHECK=`docker inspect --type container {{docker_container_name}} 2>/dev/null` if [ "$?" -eq "0" ]; then + {%- if docker_container_name == "database" %} + DOCKERMOUNT="" + {%- else %} DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"` - if [ "$DOCKERMOUNT" == "$HWSKU" ]; then + {%- endif %} + if [ x"$DOCKERMOUNT" == x"$HWSKU" ]; then + {%- if docker_container_name == "database" %} + echo "Starting existing {{docker_container_name}} container" + {%- else %} echo "Starting existing {{docker_container_name}} container with HWSKU $HWSKU" + {%- endif %} preStartAction docker start {{docker_container_name}} postStartAction