Description of problem: Install openshift client, and setup local client to connect remote master, then run `oc login`. $ oc new-app https://github.com/openshift/simple-openshift-sinatra-sti.git -o json error: none of the images that match "ruby" can build source code - check whether this is the image you want to use, then use --build=source to build using source or --build=docker to treat this as a Docker base image and set up a layered Docker build According to error message, it is saying no matched image for this app, then I tried to add --docker-image option to specify docker image - openshift/ruby-20-rhel7 (Note: this images is already existing in the output of `docker images` on node). $ oc new-app https://github.com/openshift/simple-openshift-sinatra-sti.git --docker-image=openshift/ruby-20-rhel7 -o json error: no image or template matched "openshift/ruby-20-rhel7": the repository "openshift/ruby-20-rhel7" was not found Try "openshift/ruby-20-centos7", it works, that means oc command is searching dockerhub to look for my specified image. Run the same command with "openshift/ruby-20-rhel7" on ***node***, it is also working, that means it is searching local docker images list on host where oc command is running. If my understanding is right, why --docker-image option is requiring the specified image must be existing in client host where oc command is executed? Generally in real user scenario, there would no such docker image in client host itself, Am I right? I think oc command should validate if the specified docker image is existing in remote node's docker image list, but not local client host. Version-Release number of selected component (if applicable): openshift-0.6.0.1-0.git.78.1c816ed.el7ose.x86_64 How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
new-app can only search the local docker daemon for images. Agreed this is not ideal but it is by design. It cannot search docker images on openshift nodes since it likely doesn't even have access to them.
Because this bug is saying about "search the local docker daemon for images" issue, I think is better to keep it in "open" status to tracking this issue, I guess real customer also encounter such issue once RC is released. Suggest the following resolution: 1. keep this bug in open status, and lower its severity. 2. Just what said in comment 1, because "It cannot search docker images on openshift nodes", we should skip to validate if the specified docker image is existing in docker daemon, apply user specified docker images in app's json file, and throw out a warning message about "make sure the specified image is existing in nodes" to allow user to move on, but not return error directly. Of course, I prefer to #2.
A remote end user will likely never be able to search the node's docker images for security reasons. Cesar, is getting info about the docker image required for new-app to proceed, or could it continue with a warning/--force flag, etc?
We can make new-app proceed with just the reference to the image. We wouldn't be able to expose ports and automatically determine whether it's a builder, etc. Definitely something we should look at doing post-3.0.
Jordan, Cesar: But the user will be able to search the images on nodes that the user own? So if I specify the image that I have pushed to OpenShift Docker Registry manually, new-app should be able to figure that out?
Michal, I guess if you have access to the namespace of the image that you're specifying in new-app I don't see why we can't try to find it in the openshift registry. I don't see what that has to do with the node though.
let's not get too fancy..if you have it in an openshift registry, you should have an imagestream. so 1) should allow a user to specify an image which appears to exist nowhere. they must pass an override flag to do that. 2) something is broken when you specify an image that only exists locally because the resulting imagestream has a dockerrepository value of: "dockerImageRepository": "openshift/ruby-20-rhel7:latest" where ":latest" does not belong there. Cesar/Michal agree?
https://github.com/openshift/origin/pull/4891
Verified with below version, image doesn't need to exist in client host to create app: openshift v3.0.2.0-17-g701346b kubernetes v1.1.0-alpha.0-1605-g44c91b1 oc v3.0.2.0-17-g701346b kubernetes v1.1.0-alpha.0-1605-g44c91b1 $ oc new-app https://github.com/openshift/simple-openshift-sinatra-sti.git --docker-image=registry.access.redhat.com/openshift3/ruby-20-rhel7 I1009 17:24:05.186116 616 newapp.go:357] Image "registry.access.redhat.com/openshift3/ruby-20-rhel7" is a builder, so a repository will be expected unless you also specify --strategy=docker I1009 17:24:05.186211 616 newapp.go:405] Using "https://github.com/openshift/simple-openshift-sinatra-sti.git" as the source for build imagestreams/ruby-20-rhel7 imagestreams/simple-openshift-sinatra-sti buildconfigs/simple-openshift-sinatra-sti deploymentconfigs/simple-openshift-sinatra-sti services/simple-openshift-sinatra Build "simple-openshift-sinatra-sti" created and started - you can run `oc status` to check the progress. Service "simple-openshift-sinatra" created at 172.30.173.166 with port mappings 8080. Run 'oc status' to view your app.
This fix is available in OpenShift Enterprise 3.1.