Skip to content

Commit db4904b

Browse files
author
mikespub
committed
update with Docker App
1 parent 5281041 commit db4904b

6 files changed

Lines changed: 162 additions & 5 deletions

File tree

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,24 @@ $ docker-compose up
4040

4141
```
4242
$ docker app init --compose-file docker-compose.yml python-app
43-
$ docker app build . -f python-app.dockerapp -t mikespub/python-app:0.1.0
44-
$ docker app push mikespub/python-app:0.1.0
45-
$ docker-compose up
43+
$ ...
44+
$ docker app inspect python-app.dockerapp
45+
$ docker app validate python-app.dockerapp
46+
$ docker app render python-app.dockerapp
47+
$ docker swarm init (if necessary)
48+
$ docker app install python-app.dockerapp --name my-app
49+
$ docker app status my-app
50+
$ docker app bundle my-app
51+
$ docker app push my-app -t mikespub/python-app:0.1.0
4652
```
4753

4854
### Deploying with Docker App
4955

5056
[Install Docker App.](https://github.com/docker/app#installation)
5157

5258
```
53-
$ docker app run mikespub/python-app:0.1.0
59+
$ docker app inspect mikespub/python-app:latest
60+
$ docker app install mikespub/python-app:latest
5461
```
5562

5663
**Continue with this tutorial [here](https://docs.docker.com/compose/gettingstarted/).**

bundle.json

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"name": "python-app",
3+
"version": "0.1.0",
4+
"description": "Quickstart Python with Docker App",
5+
"maintainers": [
6+
{
7+
"name": "mikespub"
8+
}
9+
],
10+
"invocationImages": [
11+
{
12+
"imageType": "docker",
13+
"image": "python-app:0.1.0-invoc"
14+
}
15+
],
16+
"images": {
17+
"redis": {
18+
"imageType": "docker",
19+
"image": "redis",
20+
"description": "redis"
21+
},
22+
"web": {
23+
"imageType": "docker",
24+
"image": "mikespub/quickstart-python",
25+
"description": "mikespub/quickstart-python"
26+
}
27+
},
28+
"actions": {
29+
"com.docker.app.inspect": {
30+
"stateless": true
31+
},
32+
"com.docker.app.render": {
33+
"stateless": true
34+
},
35+
"com.docker.app.status": {}
36+
},
37+
"parameters": {
38+
"FLASK_HOST": {
39+
"type": "string",
40+
"default": "0.0.0.0",
41+
"destination": {
42+
"env": "docker_param1"
43+
}
44+
},
45+
"FLASK_PORT": {
46+
"type": "string",
47+
"default": "5080",
48+
"destination": {
49+
"env": "docker_param2"
50+
}
51+
},
52+
"com.docker.app.kubernetes-namespace": {
53+
"type": "string",
54+
"default": "",
55+
"metadata": {
56+
"description": "Namespace in which to deploy"
57+
},
58+
"destination": {
59+
"env": "DOCKER_KUBERNETES_NAMESPACE"
60+
},
61+
"apply-to": [
62+
"install",
63+
"upgrade",
64+
"uninstall",
65+
"com.docker.app.status"
66+
]
67+
},
68+
"com.docker.app.orchestrator": {
69+
"type": "string",
70+
"default": "",
71+
"allowedValues": [
72+
"",
73+
"swarm",
74+
"kubernetes"
75+
],
76+
"metadata": {
77+
"description": "Orchestrator on which to deploy"
78+
},
79+
"destination": {
80+
"env": "DOCKER_STACK_ORCHESTRATOR"
81+
},
82+
"apply-to": [
83+
"install",
84+
"upgrade",
85+
"uninstall",
86+
"com.docker.app.status"
87+
]
88+
},
89+
"com.docker.app.render-format": {
90+
"type": "string",
91+
"default": "yaml",
92+
"allowedValues": [
93+
"yaml",
94+
"json"
95+
],
96+
"metadata": {
97+
"description": "Output format for the render command"
98+
},
99+
"destination": {
100+
"env": "DOCKER_RENDER_FORMAT"
101+
},
102+
"apply-to": [
103+
"com.docker.app.render"
104+
]
105+
},
106+
"com.docker.app.share-registry-creds": {
107+
"type": "bool",
108+
"default": false,
109+
"metadata": {
110+
"description": "Share registry credentials with the invocation image"
111+
},
112+
"destination": {
113+
"env": "DOCKER_SHARE_REGISTRY_CREDS"
114+
}
115+
}
116+
},
117+
"credentials": {
118+
"com.docker.app.registry-creds": {
119+
"path": "/cnab/app/registry-creds.json"
120+
},
121+
"docker.context": {
122+
"path": "/cnab/app/context.dockercontext"
123+
}
124+
}
125+
}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3'
1+
version: '3.6'
22
services:
33
web:
44
build: .
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.6'
2+
services:
3+
web:
4+
image: mikespub/quickstart-python
5+
links:
6+
- redis
7+
ports:
8+
- "${FLASK_PORT}:5080"
9+
environment:
10+
- FLASK_PORT=${FLASK_PORT}
11+
- FLASK_HOST=${FLASK_HOST}
12+
redis:
13+
image: redis

python-app.dockerapp/metadata.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Version of the application
2+
version: 0.1.0
3+
# Name of the application
4+
name: python-app
5+
# A short description of the application
6+
description: Quickstart Python with Docker App
7+
# List of application maintainers with name and email for each
8+
maintainers:
9+
- name: mikespub
10+
email:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FLASK_PORT: 5080
2+
FLASK_HOST: 0.0.0.0

0 commit comments

Comments
 (0)