Add Dockerfile and docker build script (#125)
author김정현/동작제어Lab(SR)/Senior Engineer/삼성전자 <jh0822.kim@samsung.com>
Thu, 22 Mar 2018 23:09:02 +0000 (08:09 +0900)
committer이성재/동작제어Lab(SR)/Principal Engineer/삼성전자 <sj925.lee@samsung.com>
Thu, 22 Mar 2018 23:09:02 +0000 (08:09 +0900)
This commit introduces `Dockerfile` of Ubuntu 16.04 and docker build/run scripts.
- To build a docker image, `cd docker;./docker_build.sh`
- To enter the docker image, `cd docker;./docker_run.sh`

This docker image is useful especially for Ubuntu 14.04 users.
ACL cannot be built on Ubuntu 14.04 due to build failure of default gcc(4.8).

Signed-off-by: Junghyun Kim <jh0822.kim@samsung.com>
docker/Dockerfile [new file with mode: 0644]
docker/common.sh [new file with mode: 0755]
docker/docker_build.sh [new file with mode: 0755]
docker/docker_run.sh [new file with mode: 0755]

diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644 (file)
index 0000000..7a771fa
--- /dev/null
@@ -0,0 +1,9 @@
+FROM ubuntu:16.04
+
+ENV http_proxy $http_proxy
+ENV https_proxy $https_proxy
+
+RUN apt-get update && apt-get --yes --force-yes install build-essential
+RUN apt-get update && apt-get --yes --force-yes install scons cmake
+RUN apt-get update && apt-get --yes --force-yes install gcc-4.9-arm-linux-gnueabihf g++-4.9-arm-linux-gnueabihf
+RUN apt-get update && apt-get --yes --force-yes install libboost-all-dev
diff --git a/docker/common.sh b/docker/common.sh
new file mode 100755 (executable)
index 0000000..ec2ca7b
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+export DOCKER_IMAGE_NAME=nnfw_docker
diff --git a/docker/docker_build.sh b/docker/docker_build.sh
new file mode 100755 (executable)
index 0000000..92cd78d
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+source ./common.sh
+
+docker build --build-arg http_proxy="$http_proxy" \
+  --build-arg https_proxy="$https_proxy" \
+  -t $DOCKER_IMAGE_NAME \
+  - < ./Dockerfile
diff --git a/docker/docker_run.sh b/docker/docker_run.sh
new file mode 100755 (executable)
index 0000000..7681692
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+source ./common.sh
+
+SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+HOST_HOME=$SCRIPT_ROOT/../
+DOCKER_HOME=/home
+
+GIT_SSL_NO_VERIFY=1
+
+DOCKER_VOLUMES+=" -v $HOST_HOME:$DOCKER_HOME"
+
+DOCKER_ENV_VARS+=" -e http_proxy"
+DOCKER_ENV_VARS+=" -e no_proxy"
+DOCKER_ENV_VARS+=" -e GIT_SSL_NO_VERIFY"
+
+DOCKER_RUN_OPTS="--rm"
+DOCKER_RUN_OPTS+=" -w $DOCKER_HOME"
+DOCKER_RUN_OPTS+=" -it"
+
+CMD="/bin/bash"
+
+docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD