I found the solution, so posting here.
The problem I was having is I was just stopping the docker container after making change in the command I was using to start the HDP image, didn't realize need to remove container as well.
Following command helped.
Save docker Work
docker commit <hdp_container_id> <hdp_container_id>
Stop and Remove docker.
docker stop <hdp_container_id>
docker rm <hdp_container_id>
Open 9083 port (hive metastore) by modifying start-sandbox-hdp-standalone_2-6-4.sh
echo "Waiting for docker daemon to start up:"
until docker ps 2>&1| grep STATUS>/dev/null; do sleep 1; done; >/dev/null
docker ps -a | grep sandbox-hdp
if [ $? -eq 0 ]; then
docker start sandbox-hdp
docker pull hortonworks/sandbox-hdp-standalone:2.6.4
docker run --name sandbox-hdp --hostname "sandbox-hdp.hortonworks.com" --privileged -d \
-p 9083:9083 \