OpenShift Create an Application from a Docker Image: Difference between revisions
Jump to navigation
Jump to search
Line 21: | Line 21: | ||
apiVersion: v1 | apiVersion: v1 | ||
kind: <font color='teal'>ImageStream</font> | '''kind''': <font color='teal'>ImageStream</font> | ||
metadata: | metadata: | ||
labels: | '''labels''': | ||
app: nexus3 | '''app''': <font color='teal'>nexus3</font> | ||
name: nexus3 | '''name''': <font color='teal'>nexus3</font> | ||
spec: | spec: | ||
lookupPolicy: | lookupPolicy: |
Revision as of 01:29, 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
Primitives
The utility creates an image stream, a deployment configuration and a service in the current project, and associate all of them with a single application by annotating them with the "app=<application-name>" label, where the application name is inferred from - and equal to - the name of the image repository given as argument.
1. Image stream. The image stream name is set to be the same as the application name.
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: