Skip to content

Commit

Permalink
IPv6: Bookinfo sample
Browse files Browse the repository at this point in the history
Modify bookinfo to use IPv6 any address to run in IPv6 only environment.
Changes to build_push_update_images.sh to use developer's docker hub
area, so that customized version can be used.  To upstream, this should
be made configurable.
  • Loading branch information
pmichali committed Mar 6, 2018
1 parent b7302ab commit 4ea619d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions samples/bookinfo/build_push_update_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@ if [ "$#" -ne 1 ]; then
fi

VERSION=$1
echo "Building images"
src/build-services.sh $VERSION
IMAGES=$(docker images -f reference=istio/examples-bookinfo*:$VERSION --format "{{.Repository}}:$VERSION")
for IMAGE in $IMAGES; do docker push $IMAGE; done
sed -i "s/\(istio\/examples-bookinfo-.*\):[[:digit:]]\.[[:digit:]]\.[[:digit:]]/\1:$VERSION/g" */bookinfo*.yaml
REMOTES=`echo ${IMAGES} | sed "s/istio\///g"`
echo "Tagging and pushing to repo $HUB"
for IMAGE in $IMAGES; do
remote=`echo $IMAGE | sed "s/istio\///"`
docker tag $IMAGE $HUB/$remote
docker push $HUB/$remote
done
echo "Modifying image location (${HUB}) in YAML files"
sed -i "s/istio\(\/examples-bookinfo-.*\):[[:digit:]]\.[[:digit:]]\.[[:digit:]]/docker.io\/$GITHUB_USER\1:$VERSION/g" */bookinfo*.yaml

2 changes: 1 addition & 1 deletion samples/bookinfo/src/details/details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

port = Integer(ARGV[0])

server = WEBrick::HTTPServer.new :BindAddress => '0.0.0.0', :Port => port
server = WEBrick::HTTPServer.new :BindAddress => '::', :Port => port

trap 'INT' do server.shutdown end

Expand Down
2 changes: 1 addition & 1 deletion samples/bookinfo/src/productpage/productpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,5 @@ def write(self, data):
sys.stderr = Writer('stderr.log')
sys.stdout = Writer('stdout.log')
print "start at port %s" % (p)
app.run(host='0.0.0.0', port=p, debug=True, threaded=True)
app.run(host='::', port=p, debug=True, threaded=True)

2 changes: 1 addition & 1 deletion samples/bookinfo/src/ratings/ratings.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ function handleRequest (request, response) {
var server = http.createServer(handleRequest)

server.listen(port, function () {
console.log('Server listening on: http://0.0.0.0:%s', port)
console.log('Server listening on: http://[::]:%s', port)
})

0 comments on commit 4ea619d

Please sign in to comment.