Revise x86 build script (#3604)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 16 Nov 2018 02:43:23 +0000 (11:43 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Fri, 16 Nov 2018 02:43:23 +0000 (11:43 +0900)
x86 build by non-root anomymous user: same userid with host user
Use docker-run-user command and remove docker setting code

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
scripts/command/docker_run_test.sh

index f6605b1..dadd19f 100755 (executable)
@@ -1,30 +1,18 @@
 #!/bin/bash
 
-SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export DOCKER_ENV_VARS
+export DOCKER_VOLUMES
 
-# DOCKER_HOME and DOCKER_ENV_VARS
-source $SCRIPT_ROOT/nnfw_docker
+pushd $NNFW_PROJECT_PATH
 
-HOST_HOME=$SCRIPT_ROOT/../..
-
-DOCKER_VOLUMES=" -v /dev/null:/dev/raw1394"
-DOCKER_VOLUMES+=" -v $HOST_HOME:$DOCKER_HOME"
-
-DOCKER_RUN_OPTS="--rm"
-DOCKER_RUN_OPTS+=" -w $DOCKER_HOME"
-
-CMD="make install"
-
-if [ "$DOCKER_INTERACTIVE" ]; then
-    DOCKER_RUN_OPTS+=" -it"
-    CMD="/bin/bash"
+if [ -n "$DOCKER_INTERACTIVE" ]; then
+  source run docker-shell
+else
+  CMD="make install"
+  source run docker-run-user bash -c "${CMD}"
 fi
+EXITCODE=$?
 
-docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD
-
-BUILD_RESULT=$?
-
-source $SCRIPT_ROOT/../docker_helper
-restore_ownership $HOST_HOME $DOCKER_HOME
+popd
 
-exit $BUILD_RESULT
+exit $EXITCODE