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

Commit d8fe337

Browse files
Various cleanings, including missing EOL, typos, comments, ...
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
1 parent 312da0c commit d8fe337

12 files changed

Lines changed: 38 additions & 41 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
*.exe binary
55
*.ico binary
66
*.jar binary
7-
vendor/** -text
7+
vendor/** -text

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,17 @@ More examples are available in the [examples](examples) directory.
149149

150150
## CNAB
151151

152-
Under the hood `docker-app` produces a CNAB bundle (a docker invocation image and a `bundle.json`) from an Application Package, but is also a generic CNAB client.
153-
CNAB proposes four actions, and docker-app adds them as commands:
152+
Under the hood `docker-app` is CNAB compliant. It generates a CNAB from your application source and is able to install and manage any other CNAB too.
153+
CNAB specifies four actions which `docker-app` provides as commands:
154154
- `install`
155155
- `upgrade`
156156
- `status`
157157
- `uninstall`
158158

159-
**Note**: These four commands needs a Docker Context to know which daemon or orchestrator to target.
159+
**Note**: These commands need a Docker Context so that `docker-app` knows which endpoint and orchestrator to target.
160160

161-
```sh
162-
$ docker context create swarm --description "swarm context" --default-stack-orchestrator=swarm --docker=host=unix:///var/run/docker.sock
161+
```console
162+
$ docker context create swarm --description "swarm context" --default-stack-orchestrator=swarm --docker=host=unix:///var/run/docker.sock
163163
swarm
164164
Successfully created context "swarm"
165165

@@ -170,7 +170,7 @@ swarm * swarm context unix:///var/run/do
170170
```
171171

172172
Here is an example installing an application package, querying a status and then uninstalling it:
173-
```sh
173+
```console
174174
$ docker-app install examples/hello-world/hello-world.dockerapp --name hello --target-context=swarm
175175
Creating network hello_default
176176
Creating service hello_hello
@@ -258,9 +258,9 @@ Options:
258258
-H, --host list Daemon socket(s) to connect to
259259
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
260260
--tls Use TLS; implied by --tlsverify
261-
--tlscacert string Trust certs signed only by this CA (default "/Users/silvin/.docker/ca.pem")
262-
--tlscert string Path to TLS certificate file (default "/Users/silvin/.docker/cert.pem")
263-
--tlskey string Path to TLS key file (default "/Users/silvin/.docker/key.pem")
261+
--tlscacert string Trust certs signed only by this CA (default "/[home]/.docker/ca.pem")
262+
--tlscert string Path to TLS certificate file (default "/[home]/.docker/cert.pem")
263+
--tlskey string Path to TLS key file (default "/[home]/.docker/key.pem")
264264
--tlsverify Use TLS and verify the remote
265265
-v, --version Print version information
266266
@@ -274,7 +274,7 @@ Commands:
274274
push Push the application to a registry
275275
render Render the Compose file for the application
276276
split Split a single-file application into multiple files
277-
status Get an application status
277+
status Get the installation status. If the installation is a docker application, the status shows the stack services.
278278
uninstall Uninstall an application
279279
upgrade Upgrade an installed application
280280
validate Checks the rendered application is syntactically correct
@@ -288,23 +288,23 @@ Run 'docker-app COMMAND --help' for more information on a command.
288288
### Bash
289289

290290
Load the docker-app completion code for bash into the current shell:
291-
```sh
291+
```console
292292
$ source <(docker-app completion bash)
293293
```
294294
Set the docker-app completion code for bash to autoload on startup in your ~/.bashrc, ~/.profile or ~/.bash_profile:
295-
```sh
295+
```console
296296
source <(docker-app completion bash)
297297
```
298298
**Note**: `bash-completion` is needed.
299299

300300
### Zsh
301301

302302
Load the docker-app completion code for zsh into the current shell
303-
```sh
303+
```console
304304
$ source <(docker-app completion zsh)
305305
```
306306
Set the docker-app completion code for zsh to autoload on startup in your ~/.zshrc
307-
```sh
307+
```console
308308
source <(docker-app completion zsh)
309309
```
310310

cmd/cnab-run/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func install(instanceName string) error {
1919
return errors.Wrap(err, "unable to restore docker context")
2020
}
2121
app, err := packager.Extract("")
22-
// todo: merge addition compose file
22+
// todo: merge additional compose file
2323
if err != nil {
2424
return err
2525
}

cmd/docker-app/init.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var (
1313
initSingleFile bool
1414
)
1515

16-
// initCmd represents the init command
1716
func initCmd() *cobra.Command {
1817
cmd := &cobra.Command{
1918
Use: "init <app-name> [-c <compose-file>] [-d <description>] [-m name:email ...]",

cmd/docker-app/inspect.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ var (
1515
inspectEnv []string
1616
)
1717

18-
// inspectCmd represents the inspect command
1918
func inspectCmd(dockerCli command.Cli) *cobra.Command {
2019
cmd := &cobra.Command{
2120
Use: "inspect [<app-name>] [-s key=value...] [-f parameters-file...]",

cmd/docker-app/install.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,18 @@ const (
3636
)
3737

3838
const longDescription = `Install the application on either Swarm or Kubernetes.
39-
Bundle name is optional, and can be
40-
- empty: resolve to any *.dockerapp file or directory in working dir
41-
- existing file path: work with any *.dockerapp file or dir, or any CNAB bundle file (signed or unsigned)
39+
Bundle name is optional, and can:
40+
- be empty and resolve to any *.dockerapp in working directory
41+
- be a BUNDLE file path and resolve to any *.dockerapp file or dir, or any CNAB file (signed or unsigned)
4242
- match a bundle name in the local duffle bundle repository
43-
- refers to a CNAB bundle in a container registry
43+
- refer to a CNAB in a container registry
4444
`
4545

46-
// installCmd represents the install command
4746
func installCmd(dockerCli command.Cli) *cobra.Command {
4847
var opts installOptions
4948

5049
cmd := &cobra.Command{
51-
Use: "install [<bundle name>] [options]",
50+
Use: "install [<bundle name>] [OPTIONS]",
5251
Aliases: []string{"deploy"},
5352
Short: "Install an application",
5453
Long: longDescription,
@@ -134,6 +133,8 @@ func runInstall(dockerCli command.Cli, appname string, opts installOptions) erro
134133
Driver: driverImpl,
135134
}
136135
err = inst.Run(c, creds, dockerCli.Out())
136+
// Even if the installation failed, the claim is persisted with its failure status,
137+
// so any installation needs a clean uninstallation.
137138
err2 := claimStore.Store(*c)
138139
if err != nil {
139140
return fmt.Errorf("install failed: %v", err)

cmd/docker-app/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func statusCmd(dockerCli command.Cli) *cobra.Command {
1515

1616
cmd := &cobra.Command{
1717
Use: "status <installation-name>",
18-
Short: "Get an application status",
18+
Short: "Get the installation status. If the installation is a docker application, the status shows the stack services.",
1919
Args: cli.ExactArgs(1),
2020
RunE: func(cmd *cobra.Command, args []string) error {
2121
return runStatus(dockerCli, args[0], opts)

examples/cnab-helm/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Requirements
22

3-
* Working Docker Desktop install with Kubernetes enabled
3+
* Any with Kubernetes enabled with [compose-on-kubernetes](https://github.com/docker/compose-on-kubernetes) installed
44
* [`docker-app` with CNAB support](https://github.com/docker/app/releases/tag/cnab-dockercon-preview) installed
55
* Source code from this directory
66
* Create a context with `docker-app context`
@@ -10,11 +10,11 @@
1010

1111
## Examples
1212

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

15+
**Note**: This example comes from [deislabs/bundles](https://github.com/deislabs/bundles/tree/master/hellohelm).
1616

17-
```
17+
```console
1818
$ docker-app install -c local bundle.json
1919
Do install for hellohelm
2020
helm install --namespace hellohelm -n hellohelm /cnab/app/charts/alpine
@@ -29,7 +29,6 @@ NAME AGE
2929
hellohelm-alpine 0s
3030
```
3131

32-
3332
Check the status of the Helm-based application:
3433

3534
```console

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
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM alpine:3.7
22

3-
CMD ["sleep", "9000"]
3+
CMD ["sleep", "9000"]

0 commit comments

Comments
 (0)