Run ODL container as non-root user 61/79261/1
authorTimoney, Dan (dt5972) <dtimoney@att.com>
Wed, 27 Feb 2019 13:49:09 +0000 (08:49 -0500)
committerTimoney, Dan (dt5972) <dtimoney@att.com>
Wed, 27 Feb 2019 13:49:09 +0000 (08:49 -0500)
Update sdnc ODL container to run as non-root user 'odl'

Change-Id: If23e061fe861eca9155874fe2462b20ca7219382
Issue-ID: SDNC-668
Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
Former-commit-id: 6f2311e494d2fa1ff8635134bf5325a3ced4881e

installation/sdnc/src/main/docker/Dockerfile

index 7f7c0de..df39210 100755 (executable)
@@ -13,6 +13,8 @@ ENV JAVA_SECURITY_DIR $SSL_CERTS_DIR/java
 ENV SDNC_NORTHBOUND_REPO mvn:org.onap.sdnc.northbound/sdnc-northbound-all/${sdnc.northbound.version}/xml/features
 
 
+USER root
+
 
 # imstall ssl and java certificates
 COPY AAF_RootCA.cer $SSL_CERTS_DIR
@@ -35,6 +37,8 @@ RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.kara
 RUN sed -i -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|"  $ODL_HOME/etc/org.apache.karaf.features.cfg
 RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-northbound-all|"  $ODL_HOME/etc/org.apache.karaf.features.cfg
 
+RUN chown -R odl /opt
+USER odl
 
 ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh
 EXPOSE 8181