---
title: "Deploy from Container Image"
canonical: "https://kb.uconn.edu/space/IKB/28727935032/Deploy%20from%20Container%20Image"
format: markdown
---
This guide covers deploying an existing container image to OpenShift, both via the web console and the CLI.

---

## Deploy via Web Console

1. Click the **+** button in the top right corner of the OpenShift console.

![image](media://eae9c425-f746-4a50-a42a-d53a264eb5ee)

![image](media://36b8d5db-4234-403e-a1af-833dcb3f9aae)

  
3. Enter the **image URL** from your container registry (e.g., Docker Hub, Red Hat Registry, or your private registry).

4. Configure the **application name**, **target port**, and **routing options**.

5. Click **Create** to deploy the application.

> **Note:** Make sure the target port matches the port your container image exposes.

---

## Deploy via CLI

```shell
# Deploy from a public image
oc new-app --name=my-app --image=registry.redhat.io/rhel8/httpd-24

# Check deployment status
oc rollout status deployment/my-app

# View pods
oc get pods

# Expose the app externally via a route
oc expose service/my-app

# Get the route URL
oc get route my-app
```

Open the URL in your browser — your app is live.

---

## Configuring Your Application

### Environment Variables

```shell
# Set environment variables
oc set env deployment/my-app DATABASE_URL=postgres://db:5432/mydb PORT=8080

# View current env vars
oc set env deployment/my-app --list
```

### Resource Limits

```shell
# Set CPU and memory limits
oc set resources deployment/my-app \
  --requests=cpu=100m,memory=256Mi \
  --limits=cpu=500m,memory=512Mi
```

### Scaling

```shell
# Scale to 3 replicas
oc scale deployment/my-app --replicas=3
```

### Health Checks

```shell
# Add a readiness probe
oc set probe deployment/my-app --readiness \
  --get-url=http://:8080/health --initial-delay-seconds=5

# Add a liveness probe
oc set probe deployment/my-app --liveness \
  --get-url=http://:8080/health --initial-delay-seconds=15
```

---

## Updating Your Application

```shell
# Update the container image
oc set image deployment/my-app my-app=your-registry.com/my-app:v2.0

# Roll back to the previous version
oc rollout undo deployment/my-app

# View rollout history
oc rollout history deployment/my-app
```

---

## Cleaning Up

```shell
# Delete all resources for an app
oc delete all -l app=my-app
```

---

*UConn ITS Infrastructure Services — OpenShift Knowledge Base*