Bug 1231749 - oc new-app --docker-image does not work even if this docker image is existing on remote node.
Summary: oc new-app --docker-image does not work even if this docker image is existing...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-15 10:42 UTC by Johnny Liu
Modified: 2015-11-23 14:25 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-23 14:25:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Johnny Liu 2015-06-15 10:42:45 UTC
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:

Comment 1 Cesar Wong 2015-06-15 18:11:01 UTC
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.

Comment 2 Johnny Liu 2015-06-16 02:57:04 UTC
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.

Comment 3 Jordan Liggitt 2015-06-16 04:46:28 UTC
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?

Comment 4 Cesar Wong 2015-06-16 15:39:08 UTC
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.

Comment 5 Michal Fojtik 2015-09-17 12:55:12 UTC
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?

Comment 6 Cesar Wong 2015-09-17 14:05:54 UTC
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.

Comment 7 Ben Parees 2015-09-29 16:26:06 UTC
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?

Comment 8 Ben Parees 2015-10-02 09:41:57 UTC
https://github.com/openshift/origin/pull/4891

Comment 9 Wenjing Zheng 2015-10-09 09:34:48 UTC
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.

Comment 10 Brenton Leanhardt 2015-11-23 14:25:05 UTC
This fix is available in OpenShift Enterprise 3.1.


Note You need to log in before you can comment on or make changes to this bug.