OpenShift Create an Application from a Docker Image: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 18: Line 18:
1. An image stream:
1. An image stream:


<syntaxhighlight lang='yaml'>
apiVersion: v1
</syntaxhighlight>
kind: ImageStream
metadata:
  labels:
    app: nexus3
  name: nexus3
spec:
  lookupPolicy:
    local: false
  tags:
    from:
      kind: DockerImage
      name: docker.io/sonatype/nexus3:latest
    name: latest
    referencePolicy:
      type: Source


2. A deployment configuration
2. A deployment configuration

Revision as of 01:23, 20 January 2018

Internal

Overview

A Docker image repository URL can be provided to oc new-app to create an application based on that image.

oc new-app <docker-repository-URL>

Example:

oc new-app docker.io/sonatype/nexus3:latest

The utility creates the following primitives, in the current project:

1. An image stream:

apiVersion: v1
kind: ImageStream
metadata:
 labels:
   app: nexus3
 name: nexus3
spec:
 lookupPolicy:
   local: false
 tags:
   from:
     kind: DockerImage
     name: docker.io/sonatype/nexus3:latest
   name: latest
   referencePolicy:
     type: Source

2. A deployment configuration

3. A service

For more details on how to deploy a production-ready Nexus instance starting with oc new-app <nexus-image-url>, go to:

Deploy Nexus Based on a Standard Sonatype Docker Image