This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.2.9. Using sample applications
odo
offers partial compatibility with any language or runtime listed within the OpenShift catalog of component types. For example:
For odo
Java and Node.js are the officially supported component types. Run odo catalog list components
to verify the officially supported component types.
In order to access the component over the web, create a URL using odo url create
.
2.9.1. Examples from Git repositories 复制链接链接已复制到粘贴板!
2.9.1.1. httpd 复制链接链接已复制到粘贴板!
This example helps build and serve static content using httpd on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see the Apache HTTP Server container image repository.
odo create httpd --git https://github.com/openshift/httpd-ex.git
$ odo create httpd --git https://github.com/openshift/httpd-ex.git
2.9.1.2. java 复制链接链接已复制到粘贴板!
This example helps build and run fat JAR Java applications on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see the Java S2I Builder image.
odo create java --git https://github.com/spring-projects/spring-petclinic.git
$ odo create java --git https://github.com/spring-projects/spring-petclinic.git
2.9.1.3. nodejs 复制链接链接已复制到粘贴板!
Build and run Node.js applications on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see the Node.js 8 container image.
odo create nodejs --git https://github.com/openshift/nodejs-ex.git
$ odo create nodejs --git https://github.com/openshift/nodejs-ex.git
2.9.1.4. perl 复制链接链接已复制到粘贴板!
This example helps build and run Perl applications on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see the Perl 5.26 container image.
odo create perl --git https://github.com/openshift/dancer-ex.git
$ odo create perl --git https://github.com/openshift/dancer-ex.git
2.9.1.5. php 复制链接链接已复制到粘贴板!
This example helps build and run PHP applications on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see the PHP 7.1 Docker image.
odo create php --git https://github.com/openshift/cakephp-ex.git
$ odo create php --git https://github.com/openshift/cakephp-ex.git
2.9.1.6. python 复制链接链接已复制到粘贴板!
This example helps build and run Python applications on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see the Python 3.6 container image.
odo create python --git https://github.com/openshift/django-ex.git
$ odo create python --git https://github.com/openshift/django-ex.git
2.9.1.7. ruby 复制链接链接已复制到粘贴板!
This example helps build and run Ruby applications on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see Ruby 2.5 container image.
odo create ruby --git https://github.com/openshift/ruby-ex.git
$ odo create ruby --git https://github.com/openshift/ruby-ex.git
2.9.1.8. wildfly 复制链接链接已复制到粘贴板!
This example helps build and run WildFly applications on CentOS 7. For more information about using this builder image, including OpenShift Container Platform considerations, see the Wildfly - CentOS Docker images for OpenShift.
odo create wildfly --git https://github.com/openshift/openshift-jee-sample.git
$ odo create wildfly --git https://github.com/openshift/openshift-jee-sample.git
2.9.2. Binary examples 复制链接链接已复制到粘贴板!
2.9.2.1. java 复制链接链接已复制到粘贴板!
Java can be used to deploy a binary artifact as follows:
git clone https://github.com/spring-projects/spring-petclinic.git cd spring-petclinic mvn package odo create java test3 --binary target/*.jar odo push
$ git clone https://github.com/spring-projects/spring-petclinic.git
$ cd spring-petclinic
$ mvn package
$ odo create java test3 --binary target/*.jar
$ odo push
2.9.2.2. wildfly 复制链接链接已复制到粘贴板!
WildFly can be used to deploy a binary application as follows: