[jbosstools-issues] [JBoss JIRA] (JBIDE-23136) Deploy Docker Wizard: Pushing image to CDK registry results in an image with no tag

Dmitrii Bocharov (JIRA) issues at jboss.org
Wed Nov 8 09:53:00 EST 2017


    [ https://issues.jboss.org/browse/JBIDE-23136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487541#comment-13487541 ] 

Dmitrii Bocharov commented on JBIDE-23136:
------------------------------------------

I'm resolving this Jira as it is not a bug.

h4. Explanation
When we deploy image to Openshift with pushing it to the registry, first of all an Image stream is created. See the example of the part of image stream yaml:
{code:yaml}
  dockerImageRepository: '172.30.1.1:5000/myproject/fedora'
  tags:
    - items:
        - created: '2017-11-08T11:44:23Z'
          dockerImageReference: >-
            172.30.1.1:5000/myproject/fedora at sha256:d17b578fcd97f98a849d81783cd82674e229ebcb209c04b772dc5181dbc8a0a1
          generation: 1
          image: >-
            sha256:d17b578fcd97f98a849d81783cd82674e229ebcb209c04b772dc5181dbc8a0a1
      tag: my-tag-2
{code}

Although tag is specified, _dockerImageReference_ field will be used to pull image during the deployment. Look at the screenshot of the events:  !pulling-by-digest.png|thumbnail! 
When you do pull by the digest, the tag is not specified. See docker documentation here: https://docs.docker.com/engine/reference/commandline/images/ (List image digests) and here https://docs.docker.com/engine/reference/commandline/pull/#pull-an-image-by-digest-immutable-identifier. There is nothing wrong with it.

Actually, it can be "fixed" by removing _removeTag_ in the _PushImageToRegistryJob_  class:
{code:java}
try {
				this.dockerConnection.removeTag(tmpImageName);
			} catch (DockerException | InterruptedException e) {
				return new Status(IStatus.WARNING, OpenShiftCoreActivator.PLUGIN_ID,
						"Pushed the selected Docker image into OpenShift registry but failed to untag it afterwards",
						e);
			}
{code}
This "untagging" is the equivalent to choosing the following 2 option in Eclipse Docker Tooling in push image wizard:  !docker-tools-push-image-options.png|thumbnail! 
See [the comment|https://issues.jboss.org/browse/JBIDE-23136?focusedCommentId=13324190&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13324190] of [~xcoulon] above for more details.
However, i don't think it's necessary to remove the "untagging" because everything works correctly, there is nothing wrong with the <none> tag for image pulled by digest and because i agree to Xavier's comment, that we need to restore the initial state.

So i'm resolving this jira by now. However if you have any more questions or have different opinion of how it must work, feel free to reopen and comment.

> Deploy Docker Wizard: Pushing image to CDK registry results in an image with no tag
> -----------------------------------------------------------------------------------
>
>                 Key: JBIDE-23136
>                 URL: https://issues.jboss.org/browse/JBIDE-23136
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 4.4.1.Final
>            Reporter: Marián Labuda
>            Assignee: Dmitrii Bocharov
>              Labels: deploy_docker_wizard, openshift_v3
>             Fix For: 4.5.x
>
>         Attachments: FedoraImageStream.png, ImagesWithDigest.png, docker-tools-push-image-options.png, eap64-basic-s2i-new-app-from-cli-1.png, eap64-basic-s2i-new-app-from-jbosstools-1.png, local-docker-images-after-pull-1.png, pulling-by-digest.png
>
>
> I have a docker connection to local docker daemon and a CDK docker connection. I am pushing an image from a docker connection to CDK registry via Deploy Image to OpenShift wizard. Push of an image pass, but it results into an image with no tag, see:
> 172.30.192.49:5000/msa/msa         <none>      238200ae067d        4 months ago        1.05 GB
> Such images are not shown in docker explorer under a docker connection because of upstream bug ERT-411
> Steps to reproduce:
> - have a project with a file named {{Dockerfile}} with the following content (1 line):
> {code}
> FROM fedora:latest
> {code}
> - Select the file in the project explorer, then {{Run As > Docker Image Build}}. Use the CDK connection and give it a name (eg: {{username/fedora}})
> - Select the image in the Docker Explorer view, then {{Deploy to OpenShift}}. 
> - In the wizard, select the option to push the image to the registry (add a dummy port if needed)
> - once the operation completed, there's an unexpected image named like {{172.30.164.33:5000/<project>/fedora}} in the output of the {{docker images}} command (in CLI)



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jbosstools-issues mailing list