Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit dbe0367

Browse files
authored
Merge pull request #512 from chris-crone/readme-20190417
Rework examples and top level README
2 parents 29aa651 + 59c5ba9 commit dbe0367

38 files changed

+515
-961
lines changed

README.md

Lines changed: 177 additions & 143 deletions
Large diffs are not rendered by default.

e2e/example_test.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package e2e
33
import (
44
"os"
55
"path/filepath"
6-
"strings"
76
"testing"
87

98
"gotest.tools/assert"
@@ -15,22 +14,12 @@ func TestExamplesAreValid(t *testing.T) {
1514
defer cleanup()
1615

1716
err := filepath.Walk("../examples", func(p string, info os.FileInfo, err error) error {
18-
appPath := filepath.Join(p, filepath.Base(p)+".dockerapp")
19-
_, statErr := os.Stat(appPath)
20-
switch {
21-
case strings.HasSuffix(p, "examples"):
22-
return nil
23-
case strings.HasSuffix(p, ".resources"):
24-
return filepath.SkipDir
25-
case !info.IsDir():
26-
return nil
27-
case os.IsNotExist(statErr):
28-
return nil
29-
default:
30-
cmd.Command = dockerCli.Command("app", "validate", appPath)
17+
if filepath.Ext(p) == ".dockerapp" {
18+
t.Log("Validate example: " + p)
19+
cmd.Command = dockerCli.Command("app", "validate", p)
3120
icmd.RunCmd(cmd).Assert(t, icmd.Success)
32-
return filepath.SkipDir
3321
}
22+
return nil
3423
})
3524
assert.NilError(t, err)
3625
}

examples/.resources/cats-or-dogs.png

-40.6 KB
Binary file not shown.

examples/.resources/hello-world.png

-23.3 KB
Binary file not shown.

examples/.resources/wordpress.png

-99 KB
Binary file not shown.

examples/README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
## Examples
22

3-
This folder contains several examples of applications built using `docker-app`, from a simple `hello-world` application to more complex, multi-service applications.
3+
This folder contains several examples of applications built using Docker
4+
Application, from a simple `hello-world` application to more complex,
5+
multi-service applications.
46

5-
### Hello world application: [hello world](hello-world)
7+
### [Hello world!](hello-world)
68

7-
To learn how to create a simple app that displays a given text.
9+
Learn how the basics of how to write a simple Docker Application.
810

9-
![Hello world app screenshot](.resources/hello-world.png "Hello world app screenshot")
11+
### [Convert an existing Compose file](voting-app)
1012

11-
### Voting application: [voting-app](voting-app)
13+
Learn how to create a Docker Application from an existing Compose file using the
14+
Docker voting app from [Docker samples](https://github.com/dockersamples).
1215

13-
To learn how to create the Docker voting app from [Docker samples](https://github.com/dockersamples).
16+
### [Docker Application CNAB generation](cnab-simple)
1417

15-
![Voting app screenshot](.resources/cats-or-dogs.png "Voting app screenshot")
18+
Create a [CNAB](https://cnab.io) `bundle.json` and invocation image from a
19+
Docker Application.
1620

17-
### WordPress application: [WordPress](wordpress)
21+
### [Deploy a Helm Chart CNAB using Docker App](cnab-helm)
1822

19-
To learn how to create a basic WordPress with a database.
20-
21-
![WordPress app screenshot](.resources/wordpress.png "WordPress app screenshot")
22-
23-
### [CNAB simple application](cnab-simple)
24-
25-
Inspect and bundle a simple application as a [CNAB](https://cnab.io).
26-
27-
### [Deploy a Helm Chart using docker-app](cnab-helm)
28-
29-
As `docker-app` is a [CNAB](https://cnab.io) compliant client, you can deploy any CNAB.
23+
As Docker App is a [CNAB](https://cnab.io) compliant client, you can deploy any
24+
CNAB.

examples/cnab-helm/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

examples/cnab-helm/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
## Requirements
1+
## Using a CNAB with Docker Application
22

3-
* Any with Kubernetes enabled with [compose-on-kubernetes](https://github.com/docker/compose-on-kubernetes) installed
4-
* [`docker-app` with CNAB support](https://github.com/docker/app/releases/tag/cnab-dockercon-preview) installed
3+
### Requirements
4+
5+
* [Docker Desktop](https://www.docker.com/products/docker-desktop) with Kubernetes enabled or any other Kubernetes cluster
56
* Source code from this directory
6-
* Create a context with `docker-app context`
7-
* Set the `DOCKER_TARGET_CONTEXT` environment variable
8-
* Helm configured for your Kubernetes cluster
9-
* A `duffle` credential set created
7+
* [Helm](https://helm.sh) configured for your Kubernetes cluster
8+
* A `duffle` [credential set](https://github.com/deislabs/duffle/blob/1847f2f7127f13f62c1377f936cba522e8947dfb/docs/proposal/201-credentialset.md) created
109

11-
## Examples
10+
### Examples
1211

13-
Install the Helm chart example using `docker-app`
12+
Install the Helm chart example using `docker app`
1413

15-
**Note**: This example comes from [deislabs/bundles](https://github.com/deislabs/bundles/tree/master/hellohelm).
14+
**Note**: This example comes from
15+
[deislabs/example-bundles](https://github.com/deislabs/example-bundles/tree/d1d95e25a2092ac170d9accd749dffa8babb2e05/hellohelm). See the [license file](./LICENSE) in this directory.
1616

1717
```console
18-
$ docker-app install -c local bundle.json
18+
$ docker app install --credential-set mycreds.yml bundle.json
1919
Do install for hellohelm
2020
helm install --namespace hellohelm -n hellohelm /cnab/app/charts/alpine
2121
NAME: hellohelm
@@ -32,7 +32,7 @@ hellohelm-alpine 0s
3232
Check the status of the Helm-based application:
3333

3434
```console
35-
$ docker-app status -c local hellohelm
35+
$ docker app status --credential-set mycreds.yml hellohelm
3636
Do Status
3737
helm status hellohelm
3838
LAST DEPLOYED: Wed Nov 28 13:58:22 2018
@@ -48,7 +48,7 @@ hellohelm-alpine 2m
4848
Uninstall the Helm-based application:
4949

5050
```console
51-
docker-app uninstall -c local hellohelm
51+
docker app uninstall --credential-set mycreds.yml hellohelm
5252
Do Uninstall
5353
helm delete --purge hellohelm
5454
release "hellohelm" deleted

examples/cnab-helm/bundle.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "hellohelm",
33
"version": "0.1.0",
4+
"schemaVersion": "v1.0.0-WD",
45
"invocationImages": [
56
{
67
"imageType": "docker",
78
"image": "cnab/hellohelm:latest"
89
}
910
],
10-
"images": [
11-
{
11+
"images": {
12+
"alpine": {
1213
"description": "alpine",
1314
"image": "technosophos/demo2alpine:0.1.0",
1415
"imageType": "docker",
@@ -19,16 +20,24 @@
1920
}
2021
]
2122
}
22-
],
23+
},
2324
"parameters": {
2425
"port": {
2526
"defaultValue": 8080,
26-
"type": "int"
27+
"type": "int",
28+
"destination": {
29+
"env": "PORT"
30+
}
2731
}
2832
},
2933
"credentials": {
3034
"kubeconfig": {
3135
"path": "/root/.kube/config"
3236
}
37+
},
38+
"actions": {
39+
"status": {
40+
"modifies": false
41+
}
3342
}
3443
}

examples/cnab-helm/cnab/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM cnab/k8sbase:latest
22

33
COPY app/Makefile /cnab/app/Makefile
4-
COPY app/charts /cnab/app/charts
4+
COPY app/charts /cnab/app/charts

0 commit comments

Comments
 (0)