
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.
18 lines
690 B
Docker
18 lines
690 B
Docker
# Copyright 2014 Google Inc. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
FROM kubernetes/test-webserver
|
|
COPY html/kitten.jpg kitten.jpg
|
|
COPY html/data.json data.json
|