Skip to content

Commit b0a6466

Browse files
committed
improve examples
1 parent d80c610 commit b0a6466

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ CMD java -Xmx64m -Xss1024k -jar /opt/app-root/springdemo.jar
3333

3434
# the application will listen on this port
3535
EXPOSE 8080
36+

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ You can run this on OpenShift (e.g. http://appuio.ch) using the Web-GUI ("Add to
1010
oc new-app openshift/jboss-webserver31-tomcat8-openshift:1.1~https://github.com/appuio/springdemo.git
1111
oc patch bc/springdemo -p '{"spec":{"resources":{"limits":{"memory":"500Mi"}}}}'
1212
oc patch dc/springdemo -p '{"spec":{"template":{"spec":{"containers":[{"name":"springdemo","resources":{"limits":{"memory": "500Mi"}}}]}}}}'
13+
oc cancel-build springdemo
1314
oc start-build springdemo
1415
oc expose service springdemo
1516
```
@@ -34,3 +35,16 @@ $ oc delete all -l app=springdemo
3435

3536
For more information about templates: see https://docs.openshift.com/container-platform/latest/dev_guide/templates.html
3637

38+
You can also build/run this example locally using docker:
39+
```
40+
docker build -t springdemo .
41+
docker run -p 8080:8080 springdemo
42+
```
43+
The application is then accessible at http://127.0.0.1:8080/
44+
45+
And you can of course also use the Docker builder on OpenShift:
46+
```
47+
oc new-app --strategy=docker https://github.com/appuio/springdemo.git
48+
oc expose service springdemo
49+
```
50+

springdemo-template.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"metadata": {
4545
"name": "${APPNAME}",
4646
"labels": {
47-
"appname": "${APPNAME}"
47+
"app": "${APPNAME}"
4848
}
4949
},
5050
"spec": {
@@ -116,7 +116,7 @@
116116
"metadata": {
117117
"name": "${APPNAME}",
118118
"labels": {
119-
"appname": "${APPNAME}"
119+
"app": "${APPNAME}"
120120
}
121121
},
122122
"spec": {
@@ -148,13 +148,13 @@
148148
"replicas": 1,
149149
"test": false,
150150
"selector": {
151-
"appname": "${APPNAME}",
151+
"app": "${APPNAME}",
152152
"deploymentconfig": "${APPNAME}"
153153
},
154154
"template": {
155155
"metadata": {
156156
"labels": {
157-
"appname": "${APPNAME}",
157+
"app": "${APPNAME}",
158158
"deploymentconfig": "${APPNAME}"
159159
}
160160
},
@@ -198,7 +198,7 @@
198198
"metadata": {
199199
"name": "${APPNAME}",
200200
"labels": {
201-
"appname": "${APPNAME}"
201+
"app": "${APPNAME}"
202202
}
203203
},
204204
"spec": {
@@ -209,7 +209,7 @@
209209
"targetPort": 8080
210210
}],
211211
"selector": {
212-
"appname": "${APPNAME}",
212+
"app": "${APPNAME}",
213213
"deploymentconfig": "${APPNAME}"
214214
}
215215
}
@@ -219,7 +219,7 @@
219219
"metadata": {
220220
"name": "${APPNAME}",
221221
"labels": {
222-
"appname": "${APPNAME}"
222+
"app": "${APPNAME}"
223223
}
224224
},
225225
"spec": {

0 commit comments

Comments
 (0)