From 9d0281914eb8a27109a16b44f783cd35eb43595c Mon Sep 17 00:00:00 2001 From: Stephen Leyva Date: Fri, 18 May 2018 15:29:57 -0400 Subject: [PATCH] docs: add docs for cli cmd build started documentation for operator-sdk and added docs for build cmd Fixes #266 --- doc/cli-guide.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 doc/cli-guide.md diff --git a/doc/cli-guide.md b/doc/cli-guide.md new file mode 100644 index 00000000000..c91acaec882 --- /dev/null +++ b/doc/cli-guide.md @@ -0,0 +1,52 @@ +# CLI User 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` +*(For more information on docker push see [docs](https://docs.docker.com/engine/reference/commandline/push/))* +