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.
This commit is contained in:
Jeff Lowdermlk
2014-12-10 12:34:19 -08:00
parent 90f71ea4d9
commit 3e3f802f2b
3 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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