Skip to content

Commit 4de6ab4

Browse files
jzacconeanimeshsingh
authored andcommitted
Add script to build and push docker images (#9)
* add script to build and push docker images to IBM registry * add reference to new docker script in readme * fix script
1 parent fcc0c9e commit 4de6ab4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ bx cr images
108108

109109
Use the following commands to build the microservers containers.
110110

111+
> **Note:** For the following steps, you can get the code and build the package by running the build_and_push_docker_images.sh script present in scripts directory.
112+
111113
Build the web-app microservice container
112114

113115
```bash
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
function buildAndPushDockerImages {
4+
cd $1
5+
docker build -t $2 .
6+
docker push $2
7+
cd ..
8+
}
9+
10+
if [ $# -ne 1 ]; then
11+
echo "usage: ./buildAndPushDockerImages.sh [bluemix container registry namespace]"
12+
exit
13+
fi
14+
15+
buildAndPushDockerImages sample.microservicebuilder.web-app registry.ng.bluemix.net/$1/microservice-webapp
16+
buildAndPushDockerImages sample.microservicebuilder.schedule registry.ng.bluemix.net/$1/microservice-schedule
17+
buildAndPushDockerImages sample.microservicebuilder.speaker registry.ng.bluemix.net/$1/microservice-speaker
18+
buildAndPushDockerImages sample.microservicebuilder.session registry.ng.bluemix.net/$1/microservice-session
19+
buildAndPushDockerImages sample.microservicebuilder.vote registry.ng.bluemix.net/$1/microservice-vote

0 commit comments

Comments
 (0)