Skip to main content
This lesson shows how to create an OpenShift ImageStream and deploy an application from a specific ImageStream tag. ImageStreams decouple your deployment resources from remote container registries by keeping tag references inside the cluster. This example uses the Sock Shop microservices demo and demonstrates creating an ImageStream for the carts service and deploying it with oc new-app.

View existing ImageStreams

In the OpenShift console go to Builds → ImageStreams. Many applications (including the Sock Shop) already create ImageStreams for their build outputs. For example, the Git-based build for the Sock Shop has an ImageStream that lists the labels associated with the image:
If you want to create a specific ImageStream for one of the Sock Shop services (for example, the carts service), click “Create Image Stream” in the console.
A Red Hat OpenShift Container Platform web console screenshot showing the ImageStreams page for the "default" project, listing image streams like "approved-apache", "goweb", and "go-web-api" with labels and creation timestamps. The left navigation (Workloads, Networking, Storage, Builds) and a "Create ImageStream" button are also visible.

Create an ImageStream for the cart service

In the create dialog, replace the placeholder YAML with the following ImageStream manifest. This ImageStream points to the external Docker image weaveworksdemos/carts:0.4.8 and creates the tag 0.4.8 in the cluster:
Quick reference: ImageStream tag fields

Verify the image and Deployment configuration

The carts Deployment used in this example pulls weaveworksdemos/carts:0.4.8. Here is the relevant portion of that Deployment for reference:

Deploy from the ImageStream with oc new-app

After creating the ImageStream, you can create an application from that tag using oc new-app. ImageStream references include the project (namespace), for example: default/carts:0.4.8 refers to the carts ImageStream in the default project with tag 0.4.8. Run:
If a Deployment (or other resource) with the same name already exists, oc new-app will fail because it tries to create duplicate resources. Example output when a deployment named carts already exists:
Inspect current deployments to confirm whether the carts deployment already exists:
If you want to re-create the deployment with oc new-app, delete the existing deployment first:
You should see a deletion confirmation:
Then re-run oc new-app:
On success you will see output similar to:
Verify the newly created deployment:
This confirms the carts application is running and was created from the ImageStream tag 0.4.8.
Remember: oc new-app creates new resources. If resources with the same names already exist (for example, a Deployment named carts), oc new-app will fail. Use oc apply, oc replace, or delete the existing resource before running oc new-app, depending on your workflow.

Watch Video