Optimize docker images and travis build
- whisk/scala: installing jre instead of jdk and nuke scala
- better base images: buildpack-deps
- drop maven from kafka and use wget instead
- install nodejs binary directly instead of apt-get it
- @rabbah consolidated common python build steps to elevate docker caching
diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile
index 53ba65a..1f16aad 100644
--- a/tools/cli/Dockerfile
+++ b/tools/cli/Dockerfile
@@ -1,12 +1,12 @@
-FROM ubuntu:14.04
+FROM buildpack-deps:trusty
ENV DEBIAN_FRONTEND noninteractive
-RUN apt-get update --fix-missing && \
- apt-get -y dist-upgrade && \
- apt-get -y install python2.7 && \
- apt-get -y install python-distribute python-pip && \
- apt-get clean
+# Upgrade and install basic Python dependencies
+RUN apt-get -y purge && \
+ apt-get -y update && \
+ apt-get -y install --fix-missing python2.7 python-distribute python-pip
+RUN apt-get clean
ADD build/tmp /cli
-CMD cd /cli && python setup.py sdist
\ No newline at end of file
+RUN cd /cli && python setup.py sdist
\ No newline at end of file
diff --git a/tools/cli/build.xml b/tools/cli/build.xml
index 3c0e0dc..3d6e050 100644
--- a/tools/cli/build.xml
+++ b/tools/cli/build.xml
@@ -5,7 +5,7 @@
<import file="../../config/config.xml" />
<!-- build the CLI python package for distribution -->
- <target name="buildCLI" >
+ <target name="buildCLI">
<var file="whisk.properties" />
@@ -15,31 +15,36 @@
<arg line="${openwhisk.home}/tools/cli/generateDefaultProps.sh" />
<arg line="${basedir}" />
</exec>
-
+
<!-- copy files needed to build image to a scratch space -->
<mkdir dir="${cli.build.dir}" />
+ <!-- make a nested build dir to match gradle -->
+ <mkdir dir="${cli.build.dir}/build/tmp" />
<copy todir="${cli.build.dir}">
+ <fileset dir="${openwhisk.home}/tools/cli">
+ <include name="Dockerfile" />
+ </fileset>
+ </copy>
+ <copy todir="${cli.build.dir}/build/tmp">
<fileset dir="${openwhisk.home}/tools/cli/packagescripts" />
</copy>
- <copy todir="${cli.build.dir}/openwhisk">
+ <copy todir="${cli.build.dir}/build/tmp/openwhisk">
<fileset dir="${openwhisk.home}/tools/cli">
- <!--<include name="default.props" />-->
- <exclude name=".project" />
- <exclude name="*.pyc" />
- <exclude name="setup.py" />
+ <include name="wsk" />
+ <include name="*.py" />
</fileset>
</copy>
<!-- generate default.props -->
- <exec executable="/bin/bash" failonerror="true" output="${cli.build.dir}/openwhisk/default.props">
+ <exec executable="/bin/bash" failonerror="true" output="${cli.build.dir}/build/tmp/openwhisk/default.props">
<arg line="${openwhisk.home}/tools/cli/generateDefaultProps.sh" />
<arg line="${basedir}" />
</exec>
<!-- Python packaging expects .py extensions. -->
- <move file="${cli.build.dir}/openwhisk/wsk" tofile="${cli.build.dir}/openwhisk/wsk.py" />
+ <move file="${cli.build.dir}/build/tmp/openwhisk/wsk" tofile="${cli.build.dir}/build/tmp/openwhisk/wsk.py" />
<!-- Need this file in the right place so it looks like a Pyton package. -->
- <move file="${cli.build.dir}/__init__.py" todir="${cli.build.dir}/openwhisk" />
+ <move file="${cli.build.dir}/build/tmp/__init__.py" todir="${cli.build.dir}/build/tmp/openwhisk" />
<!-- build package for distribution -->
<exec executable="/bin/bash" failonerror="true">
<arg line="${openwhisk.home}/tools/docker/dockerWithRetry.sh ${docker.timeout.long}" />
diff --git a/tools/cli/packagescripts/Dockerfile b/tools/cli/packagescripts/Dockerfile
deleted file mode 100644
index 8a2dcb4..0000000
--- a/tools/cli/packagescripts/Dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-FROM ubuntu:14.04
-
-ENV DEBIAN_FRONTEND noninteractive
-
-RUN apt-get update --fix-missing && \
- apt-get -y dist-upgrade && \
- apt-get -y install python2.7 && \
- apt-get -y install python-distribute python-pip && \
- apt-get clean
-
-ADD . /cli
-RUN cd /cli && python setup.py sdist
\ No newline at end of file