From 23e7ebb9ae21bd6f060961ef8c6a37b2ab330ded Mon Sep 17 00:00:00 2001 From: Stephen Leyva Date: Fri, 18 May 2018 15:29:57 -0400 Subject: [PATCH] doc/sdk-cli-reference.md: add docs for cli cmd build started documentation for operator-sdk and added docs for build cmd Fixes #266 --- doc/sdk-cli-reference.md | 51 ++++++++++++++++++++++++++++++++++++++++ doc/user-guide.md | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 doc/sdk-cli-reference.md diff --git a/doc/sdk-cli-reference.md b/doc/sdk-cli-reference.md new file mode 100644 index 00000000000..3ebc77a0e0c --- /dev/null +++ b/doc/sdk-cli-reference.md @@ -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` + diff --git a/doc/user-guide.md b/doc/user-guide.md index 824a4274836..8968c995bb2 100644 --- a/doc/user-guide.md +++ b/doc/user-guide.md @@ -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 \ No newline at end of file +[minikube_tool]:https://github.com/kubernetes/minikube#installation