From 85bea3519036e24cb08e0551c56354ef5830d18d Mon Sep 17 00:00:00 2001 From: Jeff Lowdermlk Date: Wed, 10 Dec 2014 12:34:19 -0800 Subject: [PATCH] Fix update-demo to work correctly with a web browser. The built in go http.Fileserver handles If-Modified-Since in the header by comparing it with the last modified date on the file/directory. Since the file is unaltered when we switch to a new container, that results in 304s when trying to fetch data.json, so the browser doesn't fetch the new picture after doing a rolling update. Separate issue, the Dockerfile ADD command was being interpreted as `copy html/data.json into a directory called 'html/kitten.jpg '`, instead of the `copy these 2 files into root`. Changed to separate commands using COPY, per recommended dockerfile practices. --- update-demo/images/kitten/Dockerfile | 3 ++- update-demo/images/nautilus/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/update-demo/images/kitten/Dockerfile b/update-demo/images/kitten/Dockerfile index ea142cbc..b053138b 100644 --- a/update-demo/images/kitten/Dockerfile +++ b/update-demo/images/kitten/Dockerfile @@ -13,4 +13,5 @@ # limitations under the License. FROM kubernetes/test-webserver -ADD html/data.json html/kitten.jpg / +COPY html/kitten.jpg kitten.jpg +COPY html/data.json data.json diff --git a/update-demo/images/nautilus/Dockerfile b/update-demo/images/nautilus/Dockerfile index eb7115d0..2904a107 100644 --- a/update-demo/images/nautilus/Dockerfile +++ b/update-demo/images/nautilus/Dockerfile @@ -13,4 +13,5 @@ # limitations under the License. FROM kubernetes/test-webserver -ADD html/data.json html/nautilus.jpg / +COPY html/nautilus.jpg nautilus.jpg +COPY html/data.json data.json