[SDFAB-1024] Improve Dockerfile for linux
Change-Id: Ifae48859fef1d0c376114905f29a712313023290
diff --git a/TestON/docker/Dockerfile b/TestON/docker/Dockerfile
index 2c43893..a05f3a8 100644
--- a/TestON/docker/Dockerfile
+++ b/TestON/docker/Dockerfile
@@ -55,6 +55,10 @@
chsh -s /bin/bash jenkins && \
echo jenkins:jenkins | chpasswd
+ARG ENV
+
+RUN if [ "$ENV" = "linux" ] ; then groupmod --gid 1001 jenkins && usermod --uid 1001 jenkins ; fi
+
RUN curl -sS --fail "https://repo1.maven.org/maven2/org/onosproject/onos-releases/2.5.4/onos-admin-2.5.4.tar.gz" | tar zx && \
mv onos-admin-2.5.4/* /usr/local/bin/ && \
rm -r onos-admin-2.5.4
diff --git a/TestON/docker/build.sh b/TestON/docker/build.sh
index e9a968d..964a570 100755
--- a/TestON/docker/build.sh
+++ b/TestON/docker/build.sh
@@ -14,6 +14,7 @@
TEST_ON_DIR="$(cd ${THIS_DIR}/.. && pwd)"
CONTAINER_FS="${THIS_DIR}/fs"
DI_UTIL_REPO="git@github.com:opennetworkinglab/bf-di-scripts.git"
+ENV="macos"
mkdir -p "${CONTAINER_FS}/tmp"
rm -rf "${CONTAINER_FS}/tmp/additional-py-pkgs.txt"
@@ -30,7 +31,10 @@
git clone "${DI_UTIL_REPO}" "${CONTAINER_FS}/tmp/bf-di-scripts"
echo "/tmp/bf-di-scripts/4/utility" > "${CONTAINER_FS}/tmp/additional-py-pkgs.txt"
;;
+ '--li' )
+ ENV="linux"
+ ;;
esac
done
-docker build -t teston -f "${THIS_DIR}/Dockerfile" "${TEST_ON_DIR}"
+docker build -t teston -f "${THIS_DIR}/Dockerfile" "${TEST_ON_DIR}" --build-arg ENV=$ENV