Use ONAP distribution for first ODL docker 07/96807/2
authorLuis Gomez <ecelgp@gmail.com>
Mon, 5 Jul 2021 22:54:00 +0000 (15:54 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Mon, 5 Jul 2021 23:02:03 +0000 (16:02 -0700)
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
Change-Id: If0e3265234da85cedb330fb302e39cc8eefdbef7

odl-docker/Dockerfile
odl-docker/install_docker.sh [new file with mode: 0755]

index 0edcc30d06cdc58904064741ea0a49bc74e01825..f22907cc5c9eab522ae1fc68fee370f84432d337 100644 (file)
@@ -8,5 +8,16 @@
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
 
-FROM alpine
-CMD ["echo", "Hello StackOverflow!"]
+FROM openjdk:11
+
+WORKDIR /opt/opendaylight
+
+ADD opendaylight .
+
+RUN groupadd -r karaf --gid=8181 && \
+    useradd -rm -g karaf --uid=8181 karaf && \
+    chown -R karaf:karaf .
+
+USER karaf
+EXPOSE 8101 8181
+CMD ["bin/karaf", "run"]
diff --git a/odl-docker/install_docker.sh b/odl-docker/install_docker.sh
new file mode 100755 (executable)
index 0000000..7dae6c4
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -x
+
+VERSION="0.14.1"
+FEATURES="odl-restconf,odl-netconf-topology"
+BASEDIR=$(dirname "$0")
+
+wget --progress=dot:mega -P /tmp https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/onap-karaf/${VERSION}/onap-karaf-${VERSION}.tar.gz
+tar xzf /tmp/onap-karaf-${VERSION}.tar.gz --directory ${BASEDIR}
+mv ${BASEDIR}/onap-karaf-${VERSION} ${BASEDIR}/opendaylight
+sed -i "s/\(featuresBoot= \|featuresBoot = \)/featuresBoot = ${FEATURES},/g" ${BASEDIR}/opendaylight/etc/org.apache.karaf.features.cfg
+cat ${BASEDIR}/opendaylight/etc/org.apache.karaf.features.cfg