You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/applications-create-using-cli-modify.adoc
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ The second one represents the output image. If a container image was specified a
30
30
31
31
|===
32
32
33
+
[id="specifying-environment-variables"]
33
34
== Specifying environment variables
34
35
35
36
When generating applications from a template, source, or an image, you can use the `-e|--env` argument to pass environment variables to the application container at run time:
Any `BuildConfig` objects created as part of `new-app` processing are not updated with environment variables passed with the `-e|--env` or `--env-file` argument.
71
72
====
72
73
74
+
[id="specifying-build-environment-variables"]
73
75
== Specifying build environment variables
74
76
75
77
When generating applications from a template, source, or an image, you can use the `--build-env` argument to pass environment variables to the build container at run time:
@@ -103,6 +105,7 @@ Additionally, environment variables can be given on standard input by using `--b
When generating applications from source, images, or templates, you can use the `-l|--label` argument to add labels to the created objects. Labels make it easy to collectively select, configure, and delete objects associated with the application.
@@ -112,6 +115,7 @@ When generating applications from source, images, or templates, you can use the
To see a dry-run of running the `new-app` command, you can use the `-o|--output` argument with a `yaml` or `json` value. You can then use the output to preview the objects that are created or redirect it to a file that you can edit. After you are satisfied, you can use `oc create` to create the {product-title} objects.
@@ -138,6 +142,7 @@ Create a new application by referencing the file:
138
142
$ oc create -f myapp.yaml
139
143
----
140
144
145
+
[id="creating-objects-different-names"]
141
146
== Creating objects with different names
142
147
143
148
Objects created by `new-app` are normally named after the source repository, or the image used to generate them. You can set the name of the objects produced by adding a `--name` flag to the command:
@@ -147,6 +152,7 @@ Objects created by `new-app` are normally named after the source repository, or
Normally, `new-app` creates objects in the current project. However, you can create objects in a different project by using the `-n|--namespace` argument:
@@ -156,6 +162,7 @@ Normally, `new-app` creates objects in the current project. However, you can cre
The `new-app` command allows creating multiple applications specifying multiple parameters to `new-app`. Labels specified in the command line apply to all objects created by the single command. Environment variables apply to all components created from source or images.
@@ -172,6 +179,7 @@ $ oc new-app https://github.com/openshift/ruby-hello-world mysql
172
179
If a source code repository and a builder image are specified as separate arguments, `new-app` uses the builder image as the builder for the source code repository. If this is not the intent, specify the required builder image for the source using the `~` separator.
173
180
====
174
181
182
+
[id="grouping-images-source-single-pod"]
175
183
== Grouping images and source in a single pod
176
184
177
185
The `new-app` command allows deploying multiple images together in a single pod. To specify which images to group together, use the `+` separator. The `--group` command line argument can also be used to specify the images that should be grouped together. To group the image built from a source repository with other images, specify its builder image in the group:
== Searching for images, templates, and other inputs
195
204
196
205
To search for images, templates, and other inputs for the `oc new-app` command, add the `--search` and `--list` flags. For example, to find all of the images or templates that include PHP:
@@ -199,3 +208,18 @@ To search for images, templates, and other inputs for the `oc new-app` command,
199
208
----
200
209
$ oc new-app --search php
201
210
----
211
+
212
+
[id="setting-the-import-mode"]
213
+
== Setting the import mode
214
+
215
+
To set the import mode when using `oc new-app`, add the `--import-mode` flag. This flag can be appended with `Legacy` or `PreserveOriginal`, which provides users the option to create image streams using a single sub-manifest, or all manifests, respectively.
0 commit comments