forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc/user-guide.md: add docs for cli cmd build
started documentation for operator-sdk and added docs for build cmd Fixes operator-framework#266
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/))* | ||
|