mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Pretty up the demo a little.
Use images and some better formatting. Also add scripts to help prevent typos. This based on an improved version done by Julia Ferraioli. She came up with the cool images.
This commit is contained in:
22
examples/update-demo/images/base/Dockerfile
Normal file
22
examples/update-demo/images/base/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
# 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 dockerfile/nginx
|
||||
|
||||
ADD default /etc/nginx/sites-available/default
|
||||
|
||||
ONBUILD ADD html /usr/share/nginx/html
|
||||
ONBUILD RUN chmod -R a+r /usr/share/nginx/html
|
||||
|
||||
CMD ["nginx"]
|
37
examples/update-demo/images/base/default
Normal file
37
examples/update-demo/images/base/default
Normal file
@@ -0,0 +1,37 @@
|
||||
# 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.
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server ipv6only=on;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
# Make site accessible from http://localhost/
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
expires 0;
|
||||
add_header Cache-Control private;
|
||||
|
||||
if ($request_method = 'GET') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||
}
|
||||
}
|
||||
}
|
32
examples/update-demo/images/build-images.sh
Executable file
32
examples/update-demo/images/build-images.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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.
|
||||
|
||||
# This script will build and push the images necessary for the demo.
|
||||
|
||||
if (( $# != 1 )); then
|
||||
echo "Usage: $0 <docker hub user name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOCKER_USER=$1
|
||||
|
||||
set -x
|
||||
|
||||
docker build -t update-demo-base base
|
||||
docker build -t $DOCKER_USER/update-demo:kitten kitten
|
||||
docker build -t $DOCKER_USER/update-demo:nautilus nautilus
|
||||
|
||||
docker push $DOCKER_USER/update-demo
|
15
examples/update-demo/images/kitten/Dockerfile
Normal file
15
examples/update-demo/images/kitten/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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 update-demo-base
|
3
examples/update-demo/images/kitten/html/data.json
Normal file
3
examples/update-demo/images/kitten/html/data.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"image": "kitten.jpg"
|
||||
}
|
BIN
examples/update-demo/images/kitten/html/kitten.jpg
Normal file
BIN
examples/update-demo/images/kitten/html/kitten.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
15
examples/update-demo/images/nautilus/Dockerfile
Normal file
15
examples/update-demo/images/nautilus/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# 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 update-demo-base
|
3
examples/update-demo/images/nautilus/html/data.json
Normal file
3
examples/update-demo/images/nautilus/html/data.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"image": "nautilus.jpg"
|
||||
}
|
BIN
examples/update-demo/images/nautilus/html/nautilus.jpg
Normal file
BIN
examples/update-demo/images/nautilus/html/nautilus.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Reference in New Issue
Block a user