Skip to content

Commit

Permalink
doc/sdk-cli-reference.md: add docs for cli cmd build
Browse files Browse the repository at this point in the history
started documentation for operator-sdk and added docs for build cmd

Fixes #266
  • Loading branch information
srleyva committed May 18, 2018
1 parent 49a0718 commit 23e7ebb
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
51 changes: 51 additions & 0 deletions doc/sdk-cli-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# CLI Guide

```
Usage:
operator-sdk [command]
```


## build

### Args
* image - is the container image to be built, e.g. "quay.io/example/operator:v0.0.1". This image will be automatically set in the deployment manifests.

### Flags
* `-h, --help` - help for build

### Use

The operator-sdk build command compiles the code, builds the executables,
and generates Kubernetes manifests. After build completes, the image would be built locally in docker. Then it needs to be pushed to remote registry.

### Example:

#### Build
```
operator-sdk build quay.io/example/operator:v0.0.1
// Output:
building example-operator...
building container quay.io/example/operator:v0.0.1...
Sending build context to Docker daemon 163.9MB
Step 1/4 : FROM alpine:3.6
---> 77144d8c6bdc
Step 2/4 : ADD tmp/_output/bin/example-operator /usr/local/bin/example-operator
---> 2ada0d6ca93c
Step 3/4 : RUN adduser -D example-operator
---> Running in 34b4bb507c14
Removing intermediate container 34b4bb507c14
---> c671ec1cff03
Step 4/4 : USER example-operator
---> Running in bd336926317c
Removing intermediate container bd336926317c
---> d6b58a0fcb8c
Successfully built d6b58a0fcb8c
Successfully tagged quay.io/example/operator:v0.0.1
```

#### Push
`docker push quay.io/example/operator:v0.0.1`

2 changes: 1 addition & 1 deletion doc/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ $ kubectl delete -f deploy/operator.yaml
[go_tool]:https://golang.org/dl/
[docker_tool]:https://docs.docker.com/install/
[kubectl_tool]:https://kubernetes.io/docs/tasks/tools/install-kubectl/
[minikube_tool]:https://github.com/kubernetes/minikube#installation
[minikube_tool]:https://github.com/kubernetes/minikube#installation

0 comments on commit 23e7ebb

Please sign in to comment.