Updated Helium Dockerfile to reduce size of image.
authorDaniel Farrell <dfarrell@redhat.com>
Thu, 30 Oct 2014 17:43:31 +0000 (13:43 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Thu, 30 Oct 2014 17:43:31 +0000 (13:43 -0400)
- Squash a few steps to reduce image size by 229MB.
- Functionality of image is unchanged.
- Slightly better docs in Dockerfile.

Change-Id: I22706b2699d5610a56c091a0f9bf2b88c27a7316
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
packaging/docker/Dockerfile

index 538d20ae95ec16b34c90563145606d56422b3287..1e9c00a902151bc18f506c2784891810ed3b70fa 100644 (file)
@@ -1,18 +1,19 @@
 # Base the image on Debian 7
-# Picked Debian because it's small
+# Picked Debian because it's small (85MB)
 # https://registry.hub.docker.com/_/debian/
 FROM debian:7
 MAINTAINER OpenDaylight Project <info@opendaylight.org>
 
-# Install required software
+# Install required software (170MB)
 RUN apt-get update && apt-get install -y openjdk-7-jre-headless wget
 
 # Download and install ODL
 WORKDIR /opt
-RUN wget -q "http://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.0-Helium/distribution-karaf-0.2.0-Helium.tar.gz"
 RUN mkdir opendaylight
-RUN tar -xf distribution-karaf-0.2.0-Helium.tar.gz -C opendaylight --strip-components=1
-RUN rm -rf distribution-karaf-0.2.0-Helium.tar.gz
+# Doing all of these in one step reduces the resulting image size by 229MB
+RUN wget -q "http://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.0-Helium/distribution-karaf-0.2.0-Helium.tar.gz" && \
+    tar -xf distribution-karaf-0.2.0-Helium.tar.gz -C opendaylight --strip-components=1 && \
+    rm -rf distribution-karaf-0.2.0-Helium.tar.gz
 
 # TODO: Verify that these are all of the ODL Helium ports and no extra
 # Ports