Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Openshift new-app from local Docker image


I'm trying to deploy on an Openshift Origin Pod an image which is available in my Docker repository:

$ docker images
REPOSITORY                                   TAG                 IMAGE ID            CREATED             SIZE
tomcat9demo                                  latest              535da1774da0        9 weeks ago         350.2 MB

When running:

$ oc new-app tomcat9demo --name tomcatdemo

Apparently it seems to find the image from the Docker repository:

--> Found Docker image 535da17 (9 weeks old) from  for "tomcat9demo:latest"

    * This image will be deployed in deployment config "tomcat9demo"
    * Port 8080/tcp will be load balanced by service "tomcat9demo"
      * Other containers can access this service through the hostname "tomcat9demo"
    * WARNING: Image "tomcat9demo:latest" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources with label app=tomcat9demo ...
    deploymentconfig "tomcat9demo" created
    service "tomcat9demo" created
--> Success

However the status shows an error. It seems there's an error with the image pull:

$ oc get pods
NAME                           READY     STATUS         RESTARTS   AGE
tomcat9demo-1-zrj98            0/1       ErrImagePull   0          16s
$ oc status
Error from server: the server could not find the requested resource

Do I need something else to grab the image from my local Docker repository ?

like image 373
Carla Avatar asked Nov 08 '22 23:11

Carla


1 Answers

You need to specify the option --docker-image for it to point to your local image repo. Example:

oc new-app tomcat9demo --docker-image tomcat9demo

like image 165
PARMESH Avatar answered Dec 06 '22 17:12

PARMESH