diff --git a/tools/dockerfile/grpc_node/Dockerfile b/tools/dockerfile/grpc_node/Dockerfile
index 59aa8cfd1c6a8fe2ba37b0677f144b4c48b224fb..08d060a8dea57966a01a18d77cffa48f79d86a24 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_node_base/Dockerfile b/tools/dockerfile/grpc_node_base/Dockerfile
index 20efde98addb8fb8289f2903c42dc57b31c51a04..e14e03143f72a721d400f39d614f67fed6354f27 100644
--- a/tools/dockerfile/grpc_node_base/Dockerfile
+++ b/tools/dockerfile/grpc_node_base/Dockerfile
@@ -15,6 +15,8 @@ RUN cd /var/local/git/grpc && \
   git pull --recurse-submodules && \
   git submodule update --init --recursive
 
+# 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_php/Dockerfile b/tools/dockerfile/grpc_php/Dockerfile
index 177587669c6a7532797be70af7cefcfe23134dc3..6719208ce711b3b8beffae5796bc40ad9e91971c 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 f4bf3b09a4e892ec906913c2a3b07b5bd166cff6..3d995e7a89b346bfd94fa43d828a1c2470e8a32f 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 362227bb6528ad4a200db4665829c74750960c69..901375c6bfdee9d0b206d4980196b1b7e784e0cc 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 ff1b99ba37ae3e3a4a3789b83ca0580e8dca9d93..fda55719d977af9903a8f0834eef07112e870db6 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'
diff --git a/tools/dockerfile/grpc_ruby_base/Dockerfile b/tools/dockerfile/grpc_ruby_base/Dockerfile
index a3a80daf9bef24768ab2bd3b3fb87fc8f78ae3b9..0d872069d70ed6e7ccf4363fe0c9147ca12fc177 100644
--- a/tools/dockerfile/grpc_ruby_base/Dockerfile
+++ b/tools/dockerfile/grpc_ruby_base/Dockerfile
@@ -54,5 +54,10 @@ RUN cd /var/local/git/grpc/third_party/protobuf && \
   ./configure --prefix=/usr && \
   make -j12 && make check && make install && make clean
 
+# 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
+
+# Define the default command.
+CMD ["bash"]