From 213ecbfcfac56498fb9d1ac30885e88677dc3318 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 20 Feb 2015 17:09:59 -0800 Subject: [PATCH] Fixes in Dockerfiles for Node, PHP, Ruby, speed boost for Python --- tools/dockerfile/grpc_node/Dockerfile | 7 +++++-- tools/dockerfile/grpc_php/Dockerfile | 3 +++ tools/dockerfile/grpc_php_base/Dockerfile | 3 +++ tools/dockerfile/grpc_python/Dockerfile | 4 ++-- tools/dockerfile/grpc_ruby/Dockerfile | 7 +++++-- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/dockerfile/grpc_node/Dockerfile b/tools/dockerfile/grpc_node/Dockerfile index 59aa8cfd1c6..08d060a8dea 100644 --- a/tools/dockerfile/grpc_node/Dockerfile +++ b/tools/dockerfile/grpc_node/Dockerfile @@ -1,13 +1,16 @@ # Dockerfile for gRPC Node FROM grpc/node_base -# Update the C libary +# Pull the latest sources RUN cd /var/local/git/grpc \ && git pull --recurse-submodules \ && git submodule update --init --recursive +# Prevent breaking the build if header files are added/removed. +RUN make clean -C /var/local/git/grpc + # Install the C core. -RUN make install_c -C /var/local/git/grpc +RUN make install_c -j12 -C /var/local/git/grpc RUN cd /var/local/git/grpc/src/node && npm install && node-gyp rebuild diff --git a/tools/dockerfile/grpc_php/Dockerfile b/tools/dockerfile/grpc_php/Dockerfile index 177587669c6..6719208ce71 100644 --- a/tools/dockerfile/grpc_php/Dockerfile +++ b/tools/dockerfile/grpc_php/Dockerfile @@ -5,6 +5,9 @@ RUN cd /var/local/git/grpc \ && git pull --recurse-submodules \ && git submodule update --init --recursive +# Prevent breaking the build if header files are added/removed. +RUN make clean -C /var/local/git/grpc + RUN make install_c -j12 -C /var/local/git/grpc RUN cd /var/local/git/grpc/src/php/ext/grpc && git pull && phpize diff --git a/tools/dockerfile/grpc_php_base/Dockerfile b/tools/dockerfile/grpc_php_base/Dockerfile index f4bf3b09a4e..3d995e7a89b 100644 --- a/tools/dockerfile/grpc_php_base/Dockerfile +++ b/tools/dockerfile/grpc_php_base/Dockerfile @@ -84,6 +84,9 @@ RUN wget https://phar.phpunit.de/phpunit.phar \ && chmod +x phpunit.phar \ && mv phpunit.phar /usr/local/bin/phpunit + +# TODO: pre-building seems unnecessary, because we need to run make clean +# anyway to prevent build from crashing if header files are added/removed. # Build the C core RUN make static_c shared_c -j12 -C /var/local/git/grpc diff --git a/tools/dockerfile/grpc_python/Dockerfile b/tools/dockerfile/grpc_python/Dockerfile index 362227bb652..901375c6bfd 100644 --- a/tools/dockerfile/grpc_python/Dockerfile +++ b/tools/dockerfile/grpc_python/Dockerfile @@ -1,13 +1,13 @@ # Dockerfile for GRPC Python FROM grpc/python_base -# Build the C library +# Pull the latest sources RUN cd /var/local/git/grpc \ && git pull --recurse-submodules \ && git submodule update --init --recursive # Build the C core. -RUN make install_c -C /var/local/git/grpc +RUN make install_c -j12 -C /var/local/git/grpc # Build Python GRPC RUN cd /var/local/git/grpc \ diff --git a/tools/dockerfile/grpc_ruby/Dockerfile b/tools/dockerfile/grpc_ruby/Dockerfile index ff1b99ba37a..fda55719d97 100644 --- a/tools/dockerfile/grpc_ruby/Dockerfile +++ b/tools/dockerfile/grpc_ruby/Dockerfile @@ -1,13 +1,16 @@ # Dockerfile for gRPC Ruby FROM grpc/ruby_base -# Build the C libary +# Pull the latest sources RUN cd /var/local/git/grpc \ && git pull --recurse-submodules \ && git submodule update --init --recursive +# Prevent breaking the build if header files are added/removed. +RUN make clean -C /var/local/git/grpc + # Build the C core -RUN make install_c -C /var/local/git/grpc +RUN make install_c -j12 -C /var/local/git/grpc # Build ruby gRPC and run its tests RUN /bin/bash -l -c 'cd /var/local/git/grpc/src/ruby && bundle && rake'