SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-# default DOCKER_IMAGE_NAME=nnfw_docker defined in common.sh
-source $SCRIPT_ROOT/common.sh
-echo "Using docker image $DOCKER_IMAGE_NAME"
-
-if [ -z "`docker images | grep $DOCKER_IMAGE_NAME`" ]; then
- echo "Need docker image!"
- exit 1
-fi
+# DOCKER_HOME and DOCKER_ENV_VARS
+source $SCRIPT_ROOT/nnfw_docker
HOST_PATH=$SCRIPT_ROOT/../..
-DOCKER_PATH=/home/npuci/nnfw
-
-export GIT_SSL_NO_VERIFY=1
DOCKER_VOLUMES=" -v /dev/null:/dev/raw1394"
-DOCKER_VOLUMES+=" -v $HOST_PATH:$DOCKER_PATH"
-
-DOCKER_ENV_VARS+=" -e http_proxy"
-DOCKER_ENV_VARS+=" -e no_proxy"
-DOCKER_ENV_VARS+=" -e GIT_SSL_NO_VERIFY"
+DOCKER_VOLUMES+=" -v $HOST_PATH:$DOCKER_HOME"
DOCKER_RUN_OPTS="--rm"
-DOCKER_RUN_OPTS+=" -w $DOCKER_PATH"
+DOCKER_RUN_OPTS+=" -w $DOCKER_HOME"
CMD="make install"
NNFW_OWNER_UID=$(stat -c "%u" $HOST_PATH)
NNFW_OWNER_GID=$(stat -c "%g" $HOST_PATH)
-CMD="chown -R $NNFW_OWNER_UID:$NNFW_OWNER_GID $DOCKER_PATH"
+CMD="chown -R $NNFW_OWNER_UID:$NNFW_OWNER_GID $DOCKER_HOME"
docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD
exit $BUILD_RESULT
--- /dev/null
+DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME:-nnfw_docker}
+
+echo "Using docker image $DOCKER_IMAGE_NAME"
+if [[ "$(docker images -q $DOCKER_IMAGE_NAME 2> /dev/null)" == "" ]]; then
+ echo "Need docker image: $DOCKER_IMAGE_NAME"
+ exit 1
+fi
+
+DOCKER_HOME=/home/nnfw
+
+GIT_SSL_NO_VERIFY=1
+DOCKER_ENV_VARS+=" -e http_proxy"
+DOCKER_ENV_VARS+=" -e no_proxy"
+DOCKER_ENV_VARS+=" -e GIT_SSL_NO_VERIFY"