Bug 1622291 - Cannot push locally created image to Openshift registry.
Summary: Cannot push locally created image to Openshift registry.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 3.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.10.z
Assignee: Ben Parees
QA Contact: Dongbo Yan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-25 12:53 UTC by johan
Modified: 2018-08-27 17:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-27 17:14:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description johan 2018-08-25 12:53:03 UTC
Description of problem:
I cannot push any images to the Openshift registry since about 2 weeks. 
I did deploy a number of images from my computer to the Openshift registry. The application is running successfully for some time. 

Version-Release number of selected component (if applicable):
Newest minishift. 

How reproducible:

1. Minishift start
minishift start --vm-driver=virtualbox --memory=3G
@FOR /f "tokens=* delims=^L" %i IN ('minishift docker-env') DO @call %i

2. oc login https://api.starter-us-west-1.openshift.com --token=*** 

3. docker login -u johan.holtman -p *** registry.starter-us-west-1.openshift.com

4. Buid my *.jar

5. Build an image locally
docker build -t geosolutions/geosolution:latest . 

6. Tag the image: 
docker tag geosolutions/geosolution registry.starter-us-west1.openshift.com/geosolutions/geosolution

7. Push the image
docker push registry.starter-us-west-1.openshift.com/geosolutions/geosolution

Should I set any environment variables? 
Should I use minishift only for local deployments? Should I reset variables to get connected to the us-west1 openshift environment? 

Actual results:
1. Without minishift I only saw that the image was not refreshed. So nothing change in the redeployed/restarted container. 

2. Since using minishift again I get this error: 
λ docker push registry.starter-us-west-1.openshift.com/geosolutions/geosolution
The push refers to a repository [registry.starter-us-west-1.openshift.com/geosolutions/geosolution]
An image does not exist locally with the tag: registry.starter-us-west-1.openshift.com/geosolutions/geosolution

Expected results:
A successfull push of the locally built image to the Openshift registry so that I can rollout it again. Or redeploy via the GUI. 

Additional info:

Comment 1 Ben Parees 2018-08-27 13:39:52 UTC

*** This bug has been marked as a duplicate of bug 1618718 ***

Comment 2 johan 2018-08-27 14:27:36 UTC
This is NOT a duplicate!  

Bug 1618718 was about authentication. That bug was solved. 

Pushing images is not possible. 

The issue is: I get errors during pushing of an image. 
[1] When starting Docker quickstart terminal: without an error message the image is not pushed. The image is not put into the registry. I don't know why. 
[2] When starting minishift, I get an error message. This is a different error message, see above.

Comment 3 Ben Parees 2018-08-27 15:52:42 UTC
1) why are you using minishift?  it sounds like you're just doing a docker build and docker push of an image, so where does minishift (or even the oc client) come into play?  (you can get your token from the web console, so you don't need to do a local oc login)

2) does docker images show that the image exists (within minishift), before you attempt to docker push it?  Minishift runs inside a VM so it's not clear to me where you have built the image vs where you are trying to push it from.


Also are you actually expecting the image to change? (have you changed the .jar file you are including in the image?  If not, the image will be unchanged and no deployment will happen when you push it).

If you just want to force a redeployment, you can just do that via the oc rollout command.

Comment 4 johan 2018-08-27 16:02:49 UTC
Q: Using minishift? 
A: Normally I do the steps starting with 2 (oc login etc). See above. I don't do in these cases minihift: 
A: Because it did not work anymore, I tried to start with the minishift step. I will omit it and use it only for local testing. 

Q: Am I expecting the image to change? 
A: Yes, I build a new *.jar file. I changed the sources. 

So my steps are: 
1 - oc login
2 - docker login
3 - build a new *.jar file
4 - docker build -t ... (see above)
5 - docker tag (see above)
6 - docker push (see above). 
No error message, BUT the image is not put into the openshift registry. 
Why? 
=>> Do I need to set an environment variable? 

Maybe this helps diagnosing the error: when I do this adding a tag '20':
1,2,3 - see above
4 - docker build -t geosolutions/geosolution:20 .  
5 - docker tag geosolutions/geosolution:20 registry.starter-us-west1.openshift.com/geosolutions/geosolution:20
6 - docker push registry.starter-us-west-1.openshift.com/geosolutions/geosolution:20

ERROR message: the image with the tag does not exit. 

So, whatever I do, the image is not pushed into the openshift registry.

Comment 5 Ben Parees 2018-08-27 16:07:36 UTC
> 5 - docker tag geosolutions/geosolution:20 registry.starter-us-west1.openshift.com/geosolutions/geosolution:20
> 6 - docker push registry.starter-us-west-1.openshift.com/geosolutions/geosolution:20

you've missed a dash when tagging the image ("west1" should be "west-1"), so that is why the push can't find the tag in that scenario.

For your initial scenario where the push succeeds but nothing happens, please:

1) provide the full output of the docker push
2) provide the yaml for the deployment/deploymentconfig you expect to be triggered (oc get dc mydc -o yaml)
3) provide the yaml for the geosolution imagestream. (oc get is geosolution -o yaml)

Comment 6 johan 2018-08-27 17:14:36 UTC
Thank you very much ... yes, it was west1 and should be 'west-1'. In my documentation it was abbreviated and the hiphen was removed.


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