Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
update helloworld example (#550)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
  • Loading branch information
Matthew Fisher committed Nov 30, 2018
1 parent 90d4ab4 commit 20ce169
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 103 deletions.
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,49 @@ Duffle is a command line tool that allows you to install and manage CNAB bundles

```console
$ duffle build ./examples/helloworld/
Duffle Build Started: 'helloworld': 01CS02FNS3FTM9907V83GAQQMT
helloworld: Building CNAB components: SUCCESS ⚓ (1.0090s)
Step 1/5 : FROM alpine:latest
---> 196d12cf6ab1
Step 2/5 : RUN apk add -u bash
---> Using cache
---> 54b3a85c5c2e
Step 3/5 : COPY Dockerfile /cnab/Dockerfile
---> Using cache
---> cd6f4ff8d83d
Step 4/5 : COPY app /cnab/app
---> 38a482447ffd
Step 5/5 : CMD ["/cnab/app/run"]
---> Running in 8b22055f0a37
---> e5c795c2a1f4
Successfully built e5c795c2a1f4
Successfully tagged deislabs/helloworld-cnab:64dfc7c4d825fe87506dbaba6ab038eafe2a486d
==> Successfully built bundle helloworld:0.1.0

$ duffle credentials generate helloworld-creds -f examples/helloworld/cnab/bundle.json
name: helloworld-creds
credentials:
- name: quux
source:
value: EMPTY
destination:
path: pquux
6. Check that it was built:
```console
$ duffle bundle list
NAME VERSION DIGEST SIGNED?
helloworld 0.1.0 b2747e5c36369f4c102f4f879caa94e607e5db7e true
```

$ duffle install helloworld-demo -c helloworld-creds -f examples/helloworld/cnab/bundle.json
7. Now run it:
```console
$ duffle credentials generate helloworld-creds helloworld:0.1.0
$ duffle install helloworld-demo -c helloworld-creds helloworld:0.1.0
Executing install action...

hello world
Install action
Action install complete for helloworld-demo
```

8. Clean up:
```console
$ duffle uninstall helloworld-demo
Executing uninstall action...
hello world
uninstall action
Action uninstall complete for helloworld-demo
```

*Notes:*
* Learn more about what a bundle is and its components [here](https://github.com/deislabs/cnab-spec/blob/master/100-CNAB.md).
* Get a feel for what CNAB bundles look like by referencing the [bundles repo](https://github.com/deislabs/bundles) on github.
Expand Down
9 changes: 5 additions & 4 deletions examples/helloworld/cnab/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM alpine:latest

COPY app/run /cnab/app/run
COPY bundle.json /cnab/bundle.json
COPY Dockerfile cnab/Dockerfile
RUN apk add -u bash

CMD [ "/cnab/app/run" ]
COPY Dockerfile /cnab/Dockerfile
COPY app /cnab/app

CMD ["/cnab/app/run"]
34 changes: 0 additions & 34 deletions examples/helloworld/cnab/bundle.json

This file was deleted.

29 changes: 0 additions & 29 deletions examples/helloworld/cnab/sigs/bundle.json.asc

This file was deleted.

33 changes: 33 additions & 0 deletions examples/helloworld/duffle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "helloworld",
"version": "0.1.0",
"description": "A short description of your bundle",
"keywords": [
"helloworld",
"cnab",
"tutorial"
],
"maintainers": [
{
"name": "John Doe",
"email": "john.doe@example.com",
"url": "https://example.com"
},
{
"name": "Jane Doe",
"email": "jane.doe@example.com",
"url": "https://example.com"
}
],
"components": {
"cnab": {
"name": "cnab",
"builder": "docker",
"configuration": {
"registry": "deislabs"
}
}
},
"parameters": null,
"credentials": null
}
24 changes: 0 additions & 24 deletions examples/helloworld/duffle.toml

This file was deleted.

0 comments on commit 20ce169

Please sign in to comment.