Add docker phosphorus 77/101777/3
authorLuis Gomez <ecelgp@gmail.com>
Fri, 8 Jul 2022 01:39:05 +0000 (18:39 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Mon, 19 Sep 2022 02:07:33 +0000 (19:07 -0700)
Change-Id: Id2947d6bf396de2114e7a1b0a31deb788933896c
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
docker/Dockerfile [new file with mode: 0644]
docker/README.md [new file with mode: 0644]
docker/container-tag.yaml [new file with mode: 0644]
docker/start_docker.sh [new file with mode: 0755]
docs/add-project-distribution.rst

diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644 (file)
index 0000000..bcba69c
--- /dev/null
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2021 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+FROM openjdk:11-jdk-slim AS stage0
+
+USER root
+
+RUN set -eux \
+    && cd $HOME \
+    && apt-get update \
+    && apt-get install -y curl \
+    && rm -rf /var/lib/apt/lists/* \
+    && mkdir -p /opt/opendaylight \
+    && jlink --add-modules java.base,java.compiler,java.desktop,java.logging,java.management,java.naming,java.rmi,java.security.sasl,java.sql,java.xml,jdk.jfr,jdk.naming.rmi,jdk.xml.dom,jdk.unsupported --output /opt/openjdk-11 \
+    && rm -rf /usr/local/openjdk-11 
+
+COPY start_docker.sh /opt/opendaylight
+
+FROM scratch as stage1
+
+ENV JAVA_HOME /opt/openjdk-11
+ENV PATH $PATH:$JAVA_HOME/bin
+ENV FEATURES odl-restconf-all
+
+WORKDIR /opt/opendaylight
+
+COPY --from=stage0 / /
+
+RUN set -eux \
+    && curl https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/opendaylight/15.3.0/opendaylight-15.3.0.tar.gz | tar zxf - -C /opt/opendaylight/ --strip-components 1 \
+    && groupadd -r karaf --gid=8181 \
+    && useradd -rm -g karaf --uid=8181 karaf \
+    && chown -R karaf:karaf /opt/opendaylight
+
+USER karaf
+
+EXPOSE 8101
+EXPOSE 8181
+
+CMD ./start_docker.sh
diff --git a/docker/README.md b/docker/README.md
new file mode 100644 (file)
index 0000000..5f4f507
--- /dev/null
@@ -0,0 +1,13 @@
+# OpenDaylight Docker Build
+
+Launch docker build task for ODL version 15.3.0
+
+```
+$ docker build . -f Dockerfile -t opendaylight:15.3.0
+```
+
+Run container
+
+```
+$ docker run -d -p 8181:8181 --env FEATURES=odl-restconf,odl-netconf-topology opendaylight:15.3.0
+```
diff --git a/docker/container-tag.yaml b/docker/container-tag.yaml
new file mode 100644 (file)
index 0000000..8bf22e9
--- /dev/null
@@ -0,0 +1,4 @@
+# The Jenkins job requires a tag to build the Docker image.
+# Global-JJB script assumes this file is in the repo root.
+---
+tag: 15.3.0
diff --git a/docker/start_docker.sh b/docker/start_docker.sh
new file mode 100755 (executable)
index 0000000..e8748ee
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash -e
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2021 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+set -x
+
+BASEDIR=$(dirname "$0")
+
+sed -i "s/\(featuresBoot= \|featuresBoot = \)/featuresBoot = ${FEATURES},/g" ${BASEDIR}/etc/org.apache.karaf.features.cfg
+cat ${BASEDIR}/etc/org.apache.karaf.features.cfg
+${BASEDIR}/bin/karaf run
index 5787f663a8e0f215ed66ebeda8460950ab7e7197..b944da96fef2a7277148eca97ad133572c2ff39e 100644 (file)
@@ -235,6 +235,6 @@ every time a merge happens in the project. Follow the steps below to add this tr
 
 #. Push changes to releng/builder and wait for patch verification and review.
 
-.. _managed-distribution: https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/karaf
-.. _full-distribution: https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/integration/opendaylight
+.. _managed-distribution: https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/karaf
+.. _full-distribution: https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/opendaylight
 .. _distribution-sanity: https://jenkins.opendaylight.org/releng/view/Sanity