Add non-root user to cmso-robot 51/112451/1
authorkrishnaa96 <krishna.moorthy6@wipro.com>
Thu, 10 Sep 2020 04:46:14 +0000 (10:16 +0530)
committerkrishnaa96 <krishna.moorthy6@wipro.com>
Thu, 10 Sep 2020 04:46:14 +0000 (10:16 +0530)
Issue-ID: OPTFRA-838
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: Idf960b4a80f37f4fc4ed542a586958509e42e0ff

cmso-robot/docker/Dockerfile

index c91692c..e46c140 100644 (file)
@@ -27,8 +27,10 @@ apt-get install \
             chromium-chromedriver \
             dnsutils \
             git \
-            gcc 
-            
+            gcc
+
+RUN groupadd onap \
+    && useradd -m -g onap onap
 
 COPY /onap-cmso/robot /opt/cmso-robot/robot
 COPY /onap-cmso/mocking /opt/cmso-robot/mocking
@@ -45,7 +47,11 @@ RUN ln -s /usr/bin/python3.6 /usr/bin/python && \
     pip install robotframework-sshlibrary && \
     pip install robotframework-requests
 
-### Start up the mock server for 
+RUN chown -R onap:onap /opt/cmso-robot
+
+USER onap
+
+### Start up the mock server for
 CMD ["/usr/bin/python", "/opt/cmso-robot/mocking/mock.py"]
 
 ### Use --entrypoint to override to run the tests test and exit