summaryrefslogtreecommitdiffstats
path: root/opendaylight
diff options
context:
space:
mode:
authorMatej Klotton <matej.klotton@pantheon.tech>2019-06-28 17:33:36 +0200
committerMatej Klotton <matej.klotton@pantheon.tech>2019-07-01 13:13:51 +0200
commitc6f21bed9c8144d5195232d28dfd1d1f9f1373e6 (patch)
treefb67ff910b50bd28ff81e2ab153b9383d0bf3401 /opendaylight
parent85f914068748d4446b64893b06f7a3abe6cddd6d (diff)
Reduce CCSDK docker images size
onap/ccsdk-odl-fluorine-alpine-image from 768MB to 526MB onap/ccsdk-odlsli-alpine-image from 1.36GB to 666MB Signed-off-by: Matej Klotton <matej.klotton@pantheon.tech> Change-Id: I80dca08539ea91622ccb00edbe675a0b3203a183
Diffstat (limited to 'opendaylight')
-rw-r--r--opendaylight/fluorine/fluorine-alpine/src/main/docker/Dockerfile31
1 files changed, 21 insertions, 10 deletions
diff --git a/opendaylight/fluorine/fluorine-alpine/src/main/docker/Dockerfile b/opendaylight/fluorine/fluorine-alpine/src/main/docker/Dockerfile
index a043e1e9..b5e91b92 100644
--- a/opendaylight/fluorine/fluorine-alpine/src/main/docker/Dockerfile
+++ b/opendaylight/fluorine/fluorine-alpine/src/main/docker/Dockerfile
@@ -1,18 +1,29 @@
-# Base ubuntu with added packages needed for open ecomp
+# Prepare stage for multistage image build
+## START OF STAGE0 ##
+FROM onap/ccsdk-alpine-image:${project.docker.latestfulltag.version} AS stage0
+
+# Add the opendaylight's karaf and expand
+ADD karaf-${ccsdk.opendaylight.version}.tar.gz /opt/odl
+RUN mv /opt/odl/karaf-${ccsdk.opendaylight.version} /opt/opendaylight \
+ && ln -s /opt/opendaylight /opt/opendaylight/karaf-${ccsdk.opendaylight.version} \
+ && ln -s /opt/opendaylight /opt/opendaylight/current \
+ && rmdir /opt/odl
+## END OF STAGE0 ##
+
+
FROM onap/ccsdk-alpine-image:${project.docker.latestfulltag.version}
+
MAINTAINER CCSDK Team (onap-ccsdk@lists.onap.org)
+
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV ODL_HOME /opt/opendaylight/current
-# copy the opendaylight tar and expand
-COPY karaf-${ccsdk.opendaylight.version}.tar.gz /tmp/
-RUN mkdir -p /opt/odl \
- && tar zxvf /tmp/karaf-${ccsdk.opendaylight.version}.tar.gz --directory /opt/odl \
- && rm -rf /tmp/karaf-${ccsdk.opendaylight.version}.tar.gz \
- && mv /opt/odl/karaf-${ccsdk.opendaylight.version} /opt/opendaylight \
- && ln -s /opt/opendaylight /opt/opendaylight/karaf-${ccsdk.opendaylight.version} \
- && ln -s /opt/opendaylight /opt/opendaylight/current
-
+# Create odl user
+RUN addgroup -S odl
+RUN adduser -S odl -G odl
+RUN addgroup odl wheel
+
+COPY --from=stage0 --chown=odl:odl /opt /opt
# workaround till we get proxy working
RUN mkdir -p /opt/opendaylight/system/org/mariadb/jdbc/mariadb-java-client/${ccsdk.mariadb-connector-java.version}