You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: examples/hello-world/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ At this point, an App image with the `myrepo/hello:1.0.1` tag has been built fro
93
93
94
94
## Inspecting an App image
95
95
96
-
Now let's get detailed information about the App image we just built using the `docker app image inspect` command. Note that the `--pretty` option allows to get a human friendly output rather than the JSON default output.
96
+
Now let's get detailed information about the App image we just built using the `docker app image inspect` command. Note that the `--pretty` option allows to get a human friendly output rather than the default JSON output.
@@ -143,7 +143,7 @@ myhelloworld hello-world (0.1.0) install success About a minute ago
143
143
144
144
## Inspecting a running App
145
145
146
-
Finally you can get detailed information about a running App using the `docker app inspect` command. Note that the `--pretty` option allows to get a human friendly output rather than the JSON default output.
146
+
Finally you can get detailed information about a running App using the `docker app inspect` command. Note that the `--pretty` option allows to get a human friendly output rather than the default JSON output.
Go to `voting-app.dockerapp/` and open `metadata.yml` and fill the following fields:
18
-
- description
19
-
- maintainers
25
+
In the `voting-app.dockerapp` directory, open the `metadata.yml` file and fill the "description" and "maintainers" fields.
20
26
21
-
### Edit the services
27
+
### Editing services
22
28
23
-
Open `voting-app/docker-compose.yml` and add some variables. Change the:
29
+
Now we are going to add some variables to our Compose file.
24
30
25
-
*`vote` service port from `"5000:80"` to `${vote.port}:80`
26
-
*`result` service port from `"5001:80"` to `${result.port}:80`
27
-
*`visualizer` service port from `"8080:8080"` to `${visualizer.port}:8080`
28
-
*`vote` service replicas from `2` to `${vote.replicas}`
31
+
To do so, open the `docker-compose.yml` file in the `voting-app.dockerapp` directory, and edit the following values:
29
32
30
-
In your `voting-app.dockerapp/docker-compose.yml` you should now have:
33
+
* In the `vote` service, change the port from `"5000:80"` to `${vote.port}:80`
34
+
* In the `result` service, change the port from `"5001:80"` to `${result.port}:80`
35
+
* In the `visualizer` service, change the port from `"8080:8080"` to `${visualizer.port}:8080`
36
+
* In the `vote` service, change the replicas from `2` to `${vote.replicas}`
37
+
38
+
The `voting-app.dockerapp/docker-compose.yml` file should now look like this:
31
39
32
40
```yaml
33
41
version: "3.6"
@@ -57,8 +65,7 @@ services:
57
65
58
66
### Set default parameters
59
67
60
-
Open `voting-app.dockerapp/parameters.yml` and list the variables you created
61
-
above with a default value. Note that the `.` indicates hierarchy.
68
+
Open the `voting-app.dockerapp/parameters.yml` file and define a default value for each variable you created in the `docker-compose.yml`file in the previous step.
62
69
63
70
```yaml
64
71
vote:
@@ -68,53 +75,175 @@ result:
68
75
port: 5001
69
76
```
70
77
71
-
### Add a parameters file for an environment
78
+
## Building an App image
79
+
80
+
Next, build an App image from the App definition we have created:
Now let's get detailed information about the App image we just built using the `docker app image inspect` command. Note that the `--pretty` option allows to get a human friendly output rather than the default JSON output.
Service images inside of a Docker App image are immutable, meaning that the App version ties to a fixed list of service images, and you can see it here: check the service image information in the `docker app image inspect`output above; you can see that each service (`db`, `redis`, `result`, `vote` and `worker`) has a unique service image associated at build time.
116
+
117
+
*Notes:*
118
+
* *the service image unicity is guaranteed by the tag using a digest (sha256 value)*
119
+
* *the "." in the Parameter section indicates hierarchy*
72
120
73
-
Create a `parameters/` folder to store the parameters you would use for
74
-
production.
121
+
## Running the App
75
122
76
-
```console
123
+
Now, run the App using the `docker app run`command.
124
+
125
+
```shell
126
+
$ docker app run voting-app:0.1.0 --name myvotingapp
127
+
Creating network myvotingapp_default
128
+
Creating service myvotingapp_vote
129
+
Creating service myvotingapp_result
130
+
Creating service myvotingapp_worker
131
+
Creating service myvotingapp_redis
132
+
Creating service myvotingapp_db
133
+
App "myvotingapp" running on context "default"
134
+
```
135
+
136
+
You can get detailed information about the running App using the `docker app inspect` command.
0 commit comments