[WIP] Modify `build` task to check whether `Dockerfile` is modified or not.

If the `Dockerfile` is modified,
the task should detect it and rebuild the docker image.
Modify the `build` task to rebuild the docker images.

When `Dockerfile` is modified,
the `build` task should detect it and rebuild the docker image.

This commit implements the above specification.

```
diff --git a/tasks/tests/build-images.rake b/tasks/tests/build-images.rake
index 1158243..edbec4c 100755
--- a/tasks/tests/build-images.rake
+++ b/tasks/tests/build-images.rake
@@ -4,21 +4,29 @@ require 'rake'

 desc "Build docker images"
 task :build do
-  cd "docker/ubuntu1204/" do
-    if File.exist?('../ubuntu1204.tar')
-      sh "docker load --input ../ubuntu1204.tar"
-    else
-      sh "docker build -t kazu634:ubuntu1204 --rm=true --no-cache=true ."
-      sh "docker save -o ../ubuntu1204.tar kazu634:ubuntu1204"
-    end
-  end
+  # Retrieve the list of the modified files:
+  modified_files = `git diff --name-only master..\`git symbolic-ref HEAD\``
+
+  %w{ ubuntu1204 ubuntu1404 }.each do |target_env|
+    # change directory to docker/ubuntuxxxx:
+    cd "docker/#{target_env}/" do
+
+      # If the modified files include "Dockerfile" and the docker image exists:
+      if modified_files.include?("Dockerfile") && File.exist?("../#{target_env}.tar")
+        # Delete the docker image:
+        File.unlink("../#{target_env}.tar")
+      end
+
+      # If the docker image exists:
+      if File.exist?("../#{target_env}.tar")
+        # Load it:
+        sh "docker load --input ../#{target_env}.tar"

-  cd "docker/ubuntu1404/" do
-    if File.exist?('../ubuntu1404.tar')
-      sh "docker load --input ../ubuntu1404.tar"
-    else
-      sh "docker build -t kazu634:ubuntu1404 --rm=true --no-cache=true ."
-      sh "docker save -o ../ubuntu1404.tar kazu634:ubuntu1404"
+      # otherwise build the docker image:
+      else
+        sh "docker build -t kazu634:#{target_env} --rm=true --no-cache=true ."
+        sh "docker save -o ../#{target_env}.tar kazu634:#{target_env}"
+      end
     end
   end
 end
```
Merge pull request #148 from kazu634/modify-build-image-task

Modify `build` task to check whether `Dockerfile` is modified or not.