1OC(1)                              June 2016                             OC(1)
2
3
4

NAME

6       oc new-build - Create a new build configuration
7
8
9

SYNOPSIS

11       oc new-build [OPTIONS]
12
13
14

DESCRIPTION

16       Create a new build by specifying source code
17
18
19       This command will try to create a build configuration for your applica‐
20       tion using images and code that has a public repository. It will lookup
21       the  images  on  the local Docker installation (if available), a Docker
22       registry, or an image stream.
23
24
25       If you specify a source code URL, it will set up  a  build  that  takes
26       your source code and converts it into an image that can run inside of a
27       pod. Local source must be in a git repository that has a remote reposi‐
28       tory that the server can see.
29
30
31       Once  the  build configuration is created a new build will be automati‐
32       cally triggered. You can use 'oc status' to check the progress.
33
34
35

OPTIONS

37       --allow-missing-images=false
38           If true, indicates that referenced Docker  images  that  cannot  be
39       found locally or in a registry should still be used.
40
41
42       --allow-missing-imagestream-tags=false
43           If  true,  indicates that image stream tags that don't exist should
44       still be used.
45
46
47       --allow-missing-template-keys=true
48           If true, ignore any errors in templates when a field or map key  is
49       missing  in  the  template.  Only applies to golang and jsonpath output
50       formats.
51
52
53       --binary=false
54           Instead of expecting a source URL, set the build to  expect  binary
55       contents. Will disable triggers.
56
57
58       --build-arg=[]
59           Specify a key-value pair to pass to Docker during the build.
60
61
62       --build-config-map=[]
63           ConfigMap and destination to use as an input for the build.
64
65
66       --build-secret=[]
67           Secret and destination to use as an input for the build.
68
69
70       --code=[]
71           Source code in the build configuration.
72
73
74       --context-dir=""
75           Context directory to be used for the build.
76
77
78       --docker-image=[]
79           Name of a Docker image to use as a builder.
80
81
82       -D, --dockerfile=""
83           Specify  the  contents  of  a Dockerfile to build directly, implies
84       --strategy=docker. Pass '-' to read from STDIN.
85
86
87       --dry-run=false
88           If true, show the result of the operation without performing it.
89
90
91       -e, --env=[]
92           Specify a key-value pair for an environment variable  to  set  into
93       resulting image.
94
95
96       --env-file=[]
97           File  containing  key-value  pairs  of environment variables to set
98       into each container.
99
100
101       -i, --image-stream=[]
102           Name of an image stream to to use as a builder.
103
104
105       -l, --labels=""
106           Label to set in all generated resources.
107
108
109       --name=""
110           Set name to use for generated build artifacts.
111
112
113       --no-output=false
114           If true, the build output will not be pushed anywhere.
115
116
117       -o, --output=""
118           Output format. One of: json|yaml|name|templatefile|template|go-tem‐
119       plate|go-template-file|jsonpath|jsonpath-file.
120
121
122       --output-version=""
123           The preferred API versions of the output objects
124
125
126       --push-secret=""
127           The  name of an existing secret that should be used for pushing the
128       output image.
129
130
131       -a, --show-all=true
132           When printing, show all  resources  (false  means  hide  terminated
133       pods.)
134
135
136       --show-labels=false
137           When  printing,  show  all  labels as the last column (default hide
138       labels column)
139
140
141       --sort-by=""
142           If non-empty, sort list types using this field specification.   The
143       field  specification  is  expressed  as  a  JSONPath  expression  (e.g.
144       '{.metadata.name}'). The field in the API resource  specified  by  this
145       JSONPath expression must be an integer or a string.
146
147
148       --source-image=""
149           Specify  an  image  to  use as source for the build.  You must also
150       specify --source-image-path.
151
152
153       --source-image-path=""
154           Specify the file or directory to copy from the source image and its
155       destination in the build directory. Format: [source]:[destination-dir].
156
157
158       --source-secret=""
159           The  name  of  an existing secret that should be used for cloning a
160       private git repository.
161
162
163       --strategy=
164           Specify the build strategy to use  if  you  don't  want  to  detect
165       (docker|pipeline|source).
166
167
168       --template=""
169           Template  string  or  path  to template file to use when -o=go-tem‐
170       plate, -o=go-template-file. The template format is golang  templates  [
171http://golang.org/pkg/text/template/#pkg-overview⟩].
172
173
174       --to=""
175           Push built images to this image stream tag (or Docker image reposi‐
176       tory if --to-docker is set).
177
178
179       --to-docker=false
180           If true, have the build output push to a Docker repository.
181
182
183

OPTIONS INHERITED FROM PARENT COMMANDS

185       --allow_verification_with_non_compliant_keys=false
186           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
187       non-compliant with RFC6962.
188
189
190       --alsologtostderr=false
191           log to standard error as well as files
192
193
194       --application_metrics_count_limit=100
195           Max number of application metrics to store (per container)
196
197
198       --as=""
199           Username to impersonate for the operation
200
201
202       --as-group=[]
203           Group  to  impersonate for the operation, this flag can be repeated
204       to specify multiple groups.
205
206
207       --azure-container-registry-config=""
208           Path to the file containing Azure container registry  configuration
209       information.
210
211
212       --boot_id_file="/proc/sys/kernel/random/boot_id"
213           Comma-separated  list  of files to check for boot-id. Use the first
214       one that exists.
215
216
217       --cache-dir="/builddir/.kube/http-cache"
218           Default HTTP cache directory
219
220
221       --certificate-authority=""
222           Path to a cert file for the certificate authority
223
224
225       --client-certificate=""
226           Path to a client certificate file for TLS
227
228
229       --client-key=""
230           Path to a client key file for TLS
231
232
233       --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
234           CIDRs opened in GCE firewall for LB traffic proxy  health checks
235
236
237       --cluster=""
238           The name of the kubeconfig cluster to use
239
240
241       --container_hints="/etc/cadvisor/container_hints.json"
242           location of the container hints file
243
244
245       --containerd="unix:///var/run/containerd.sock"
246           containerd endpoint
247
248
249       --context=""
250           The name of the kubeconfig context to use
251
252
253       --default-not-ready-toleration-seconds=300
254           Indicates    the    tolerationSeconds   of   the   toleration   for
255       notReady:NoExecute that is added by default to every pod that does  not
256       already have such a toleration.
257
258
259       --default-unreachable-toleration-seconds=300
260           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
261       able:NoExecute that is added by default to  every  pod  that  does  not
262       already have such a toleration.
263
264
265       --docker="unix:///var/run/docker.sock"
266           docker endpoint
267
268
269       --docker-tls=false
270           use TLS to connect to docker
271
272
273       --docker-tls-ca="ca.pem"
274           path to trusted CA
275
276
277       --docker-tls-cert="cert.pem"
278           path to client certificate
279
280
281       --docker-tls-key="key.pem"
282           path to private key
283
284
285       --docker_env_metadata_whitelist=""
286           a  comma-separated  list of environment variable keys that needs to
287       be collected for docker containers
288
289
290       --docker_only=false
291           Only report docker containers in addition to root stats
292
293
294       --docker_root="/var/lib/docker"
295           DEPRECATED: docker root is read from docker info (this is  a  fall‐
296       back, default: /var/lib/docker)
297
298
299       --enable_load_reader=false
300           Whether to enable cpu load reader
301
302
303       --event_storage_age_limit="default=24h"
304           Max length of time for which to store events (per type). Value is a
305       comma separated list of key values, where  the  keys  are  event  types
306       (e.g.: creation, oom) or "default" and the value is a duration. Default
307       is applied to all non-specified event types
308
309
310       --event_storage_event_limit="default=100000"
311           Max number of events to store (per type). Value is  a  comma  sepa‐
312       rated  list  of  key values, where the keys are event types (e.g.: cre‐
313       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
314       applied to all non-specified event types
315
316
317       --global_housekeeping_interval=0
318           Interval between global housekeepings
319
320
321       --housekeeping_interval=0
322           Interval between container housekeepings
323
324
325       --insecure-skip-tls-verify=false
326           If true, the server's certificate will not be checked for validity.
327       This will make your HTTPS connections insecure
328
329
330       --kubeconfig=""
331           Path to the kubeconfig file to use for CLI requests.
332
333
334       --log-flush-frequency=0
335           Maximum number of seconds between log flushes
336
337
338       --log_backtrace_at=:0
339           when logging hits line file:N, emit a stack trace
340
341
342       --log_cadvisor_usage=false
343           Whether to log the usage of the cAdvisor container
344
345
346       --log_dir=""
347           If non-empty, write log files in this directory
348
349
350       --logtostderr=true
351           log to standard error instead of files
352
353
354       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
355           Comma-separated list of files to  check  for  machine-id.  Use  the
356       first one that exists.
357
358
359       --match-server-version=false
360           Require server version to match client version
361
362
363       -n, --namespace=""
364           If present, the namespace scope for this CLI request
365
366
367       --request-timeout="0"
368           The  length  of  time  to  wait before giving up on a single server
369       request. Non-zero values should contain a corresponding time unit (e.g.
370       1s, 2m, 3h). A value of zero means don't timeout requests.
371
372
373       -s, --server=""
374           The address and port of the Kubernetes API server
375
376
377       --stderrthreshold=2
378           logs at or above this threshold go to stderr
379
380
381       --storage_driver_buffer_duration=0
382           Writes  in  the  storage driver will be buffered for this duration,
383       and committed to the non memory backends as a single transaction
384
385
386       --storage_driver_db="cadvisor"
387           database name
388
389
390       --storage_driver_host="localhost:8086"
391           database host:port
392
393
394       --storage_driver_password="root"
395           database password
396
397
398       --storage_driver_secure=false
399           use secure connection with database
400
401
402       --storage_driver_table="stats"
403           table name
404
405
406       --storage_driver_user="root"
407           database username
408
409
410       --token=""
411           Bearer token for authentication to the API server
412
413
414       --user=""
415           The name of the kubeconfig user to use
416
417
418       -v, --v=0
419           log level for V logs
420
421
422       --version=false
423           Print version information and quit
424
425
426       --vmodule=
427           comma-separated list of pattern=N settings for  file-filtered  log‐
428       ging
429
430
431

EXAMPLE

433                # Create a build config based on the source code in the current git repository (with a public
434                # remote) and a Docker image
435                oc new-build . --docker-image=repo/langimage
436
437                # Create a NodeJS build config based on the provided [image] [source code] combination
438                oc new-build centos/nodejs-8-centos7 https://github.com/sclorg/nodejs-ex.git
439
440                # Create a build config from a remote repository using its beta2 branch
441                oc new-build https://github.com/openshift/ruby-hello-world#beta2
442
443                # Create a build config using a Dockerfile specified as an argument
444                oc new-build -D $'FROM centos:7\nRUN yum install -y httpd'
445
446                # Create a build config from a remote repository and add custom environment variables
447                oc new-build https://github.com/openshift/ruby-hello-world -e RACK_ENV=development
448
449                # Create a build config from a remote private repository and specify which existing secret to use
450                oc new-build https://github.com/youruser/yourgitrepo --source-secret=yoursecret
451
452                # Create a build config from a remote repository and inject the npmrc into a build
453                oc new-build https://github.com/openshift/ruby-hello-world --build-secret npmrc:.npmrc
454
455                # Create a build config from a remote repository and inject environment data into a build
456                oc new-build https://github.com/openshift/ruby-hello-world --build-config-map env:config
457
458                # Create a build config that gets its input from a remote repository and another Docker image
459                oc new-build https://github.com/openshift/ruby-hello-world --source-image=openshift/jenkins-1-centos7 --source-image-path=/var/lib/jenkins:tmp
460
461
462
463

SEE ALSO

465       oc(1),
466
467
468

HISTORY

470       June 2016, Ported from the Kubernetes man-doc generator
471
472
473
474Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum