anchor.diff:  Create a new OpenShift application by using the
   link:../architecture/infrastructure_components/web_console.html[web console] or
   by running the `oc new-app` command from the CLI. OpenShift creates a new
  -application by specifying source code,
  -link:../architecture/core_concepts/templates.html[templates], and
  -link:../architecture/core_concepts/containers_and_images.html#docker-images[images].
  -OpenShift looks for images on the local Docker installation (if available), in a
  +application by specifying
  +link:#specifying-source-code[source code],
  +link:#specifying-an-image[images], or
  +link:#specifying-a-template[templates]. The OpenShift
  +new-app CLI command looks for images on the local Docker installation (if available), in a
   link:../architecture/infrastructure_components/image_registry.html[Docker
   registry], or an OpenShift image stream.
   
  -If you specify a source code URL, OpenShift takes your source code and converts
  -it into an image that can run inside of a
  -link:../architecture/core_concepts/pods_and_services.html#pods[pod]. Images are
  -deployed via a
  -link:../architecture/core_concepts/deployments.html#deployments-and-deployment-configurations[deployment
  -configuration], and a
  -link:../architecture/core_concepts/pods_and_services.html#services[service] is
  -hooked up to the first public port of the application.
  +If you specify source code, new-app will attempt to construct a 
  +link:builds.html#defining-a-buildconfig[build configuration] 
  +that will build your source into a new application
  +link:../architecture/core_concepts/builds_and_image_streams.html#image-streams[image].
  +It will also construct a 
  +link:../architecture/core_concepts/deployments.html#deployments-and-deployment-configurations[deployment configuration] that 
  +will deploy that new image, and a 
  +link:../architecture/core_concepts/pods_and_services.html#services[service] to provide load balanced
  +access to the deployment that is running your image.
   
   [NOTE]
   ====
  
positive.code: ----
  ====
  
  When creating an application based on a stored link:templates.html[template],
  use the `-p|--param` to set parameter values defined by the template:
  
  ----
  $ oc new-app <template_name> -p ADMIN_USERNAME=<user>,ADMIN_PASSWORD=<pass>
  ----
  
  == Using the Web Console
  
  
negative.code: 
  == Using the CLI
  
  === Specifying source code
  
  New-app allows you to create applications using source code from a local or a remote git repository.
  If only a source repository is specified, new-app will try to automatically
  link:#build-strategy-detection[determine the type of]
  link:../architecture/core_concepts/builds_and_image_streams.html#builds[build strategy]
  to use (`Docker` or `Source`), and in the case of Source type builds,
  link:#language-detection[an appropriate language builder image].
  
  You can tell new-app to use a subdirectory of your source code repository by specifying a `--context` flag. Also, when specifying
  a remote URL, you can specify a git reference to use by appending `#[reference]` to the end of the URL.
  
  
  [NOTE]
  ====
  If using a local git repository, the repository must have an `origin` remote that points to a URL accessible by the OpenShift cluster.
  ====
  
  .Creating an application using the git repository at the current directory
  ====
  ----
  $ oc new-app .
  ----
  ====
  
  .Creating an application using a remote git repository and a context subdirectory
  ====
  ----
  $ oc new-app https://github.com/openshift/sti-ruby.git --context=2.0/test/puma-test-app
  ----
  ====
  
  .Creating an application using a remote git repository with a specific branch reference
  ====
  ----
  $ oc new-app https://github.com/openshift/ruby-hello-world.git#beta4
  ----
  ====
  
  
  ==== Build strategy detection
  
  If new-app finds a `Dockerfile` in the repository, it will generate a 
  link:../architecture/core_concepts/builds_and_image_streams.html#docker-build[Docker build strategy], otherwise it will generate a
  link:../architecture/core_concepts/builds_and_image_streams.html#source-build[Source strategy]. 
  To use a specific strategy set the `--strategy` flag to either `source` or `docker`.
  
  .Force new-app to use the Docker strategy for a local source repository
  ====
  ----
  $ oc new-app /home/user/code/myapp --strategy=docker
  ----
  ====
  
  ==== Language detection
  If creating a Source build, new-app will attempt to determine which language builder to use based on the presence of certain files
  in the root of the repository:
  
  .Languages detected by new-app
  [cols="4,8",options="header"]
  |===
  
  |Language |Files
  
  a|`ruby`
  a|Rakefile, Gemfile, config.ru
  
  a|`jee`
  a|pom.xml
  
  a|`nodejs`
  a|app.json, package.json
  
  a|`php`
  a|index.php, composer.json
  
  a|`python`
  a|requirements.txt, config.py
  
  a|`perl`
  a|index.pl, cpanfile
  |===
  
  Once a language is detected, new-app will search the OpenShift server for image stream tags that have a `supports` annotation
  that matches the detected language or an image stream that matches the name of the detected language. If a match is not found, 
  the DockerHub registry is searched for an image that matches the detected language based on name.
  
  To override the image that new-app uses as the builder for a particular source repository, the image (either as image stream or Docker
  specification) can be specified along with the repository using a `~` as a separator.
  
  .Use image stream myproject/my-ruby to build the source at a remote github repository
  ====
  ----
  $ oc new-app myproject/my-ruby~https://github.com/openshift/ruby-hello-world.git
  ----
  ====
  
  .Use Docker image openshift/ruby-20-centos7:latest to build source in a local repository
  ====
  ----
  $ oc new-app openshift/ruby-20-centos7:latest~/home/user/code/my-ruby-app
  ----
  ====
  
  === Specifying an image
  
  New-app will generate the necessary artifacts to deploy an existing image as an application. Images can come from image streams in
  the OpenShift server, images in a specific registry or DockerHub, or images in the local Docker server. New-app will attempt to determine
  the type of image specified in the arguments passed to it. However, you can explicitly tell new-app whether the image is a docker image (using the 
  `--docker-image` argument) or an image stream (using the `-i|--image` argument).
  
  
  [NOTE]
  ====
  If you specify an image from your local Docker repository, you will need to ensure that the same image is available
  to the OpenShift cluster nodes.
  ====
  
  
  
  .Creating an application from the https://registry.hub.docker.com/_/mysql/[DockerHub MySQL Image]:
  ====
  ----
  $ oc new-app mysql
  ----
  ====
  
  To create an application using an image in a private registry, specify the full Docker image specification:
  .Creating an application from a local registry
  ----
  $ oc new-app myregistry:5000/example/myimage
  ----
  
  [NOTE]
  ====
  If the registry that the image comes from is not secured with SSL, make sure that the Docker daemon on the OpenShift nodes
  is run with the `--insecure-registry` flag pointing to that registry. You also need to tell new-app that the image comes from 
  an insecure registry with the `--insecure-registry=true` flag.
  ====
  
  To create an application from an existing 
  link:../architecture/core_concepts/builds_and_image_streams.html#image-streams[image stream], specify the namespace (optional), name, and tag (optional) for the 
  image stream:
  
  .Create an application from an existing image stream, with a specific tag
  ====
  ----
  $ oc new-app my-stream:v1
  ----
  ====
  
  === Specifying a template
  
  New-app can instantiate a link:templates.html[template] from a previouly stored template 
  or from a template file.
  To instantiate a  a previously-stored template, specify the name of the template 
  as an argument. For example, store a
  https://github.com/openshift/origin/tree/master/examples/sample-app[sample
  application template] and use it to create an application:
  
  .Creating an application from a previously stored template
  ====
  ----
  $ oc create -f examples/sample-app/application-template-stibuild.json
  