Project

General

Profile

Bug #10404

Bad URI error message when creating Docker container from Docker Hub page

Added by Partha Aji over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1209639
Description of problem:

Trying to create a new Docker container using the Docker Hub form is now failing with a bad URI error (see attached screenshot).

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

How reproducible:

Steps to Reproduce:
1. Create a new Docker container
2. Select the proper compute resource
3. Select the Docker Hub form
4. Type 'wordpress' and then click the 'search' button (ie. magnifying glass button)

Actual results:

The screenshot shows an error message. Also, the message says to use the "Foreman ticketing system" instead of Red Hat Bugzilla.

Expected results:

Additional info:

Associated revisions

Revision c36fdec1 (diff)
Added by Partha Aji over 7 years ago

Fixes #10404 - Finds correct repo name for Docker Hub registry

Bug is stated as follows
on centos 7 ->

$ docker version
Client version: 1.5.0-dev
Client API version: 1.18
Go version (client): go1.3.3

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io: docker.io/centos The official build of CentOS. 978 [OK]
docker.io: docker.io/ansible/centos7-ansible Ansible on Centos7 40 [OK]
.....

On fedora 20 ->
$ docker version
Client version: 1.5.0
Client API version: 1.17

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 978 [OK]
ansible/centos7-ansible Ansible on Centos7 40 [OK]
......

Note the "docker.io: " prefix for the centos 7 name columns
http://rhelblog.redhat.com/2015/04/15/understanding-the-changes-to-docker-search-and-docker-pull-in-red-hat-enterprise-linux-7-1/
has details on why thats the case.

When you ask foreman-docker "search centos from docker hub", it gives
you different names based on whether the docker compute resource is
running on el7 or fedora 20. You then select an image and it shows the
tags for that. Based on your selections it picks "NAME" as the repo name
and chooses the tag. This works for docker compute instance running on
f20 and used to work for docker instance on el7.

Anyway problem is simple -> "docker.io: docker.io/centos" is not a valid
repo name. So foreman-docker has to somehow infer that
"docker.io/centos" is what the repo name should be and strip out
"docker.io: " while it should some how also work for
"my-other-registry.com:4000/cool-repo" and not strip out
"my-other-registry.com:4000".

This commit achieves to do that.

Also removing the hub_url code generation code because we'd need some
logic that converts docker.io/_/centos to
hub.registry.docker.com/_centos_/ and also work for rhel and regular
cases.

Revision c36fdec1 (diff)
Added by Partha Aji over 7 years ago

Fixes #10404 - Finds correct repo name for Docker Hub registry

Bug is stated as follows
on centos 7 ->

$ docker version
Client version: 1.5.0-dev
Client API version: 1.18
Go version (client): go1.3.3

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io: docker.io/centos The official build of CentOS. 978 [OK]
docker.io: docker.io/ansible/centos7-ansible Ansible on Centos7 40 [OK]
.....

On fedora 20 ->
$ docker version
Client version: 1.5.0
Client API version: 1.17

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 978 [OK]
ansible/centos7-ansible Ansible on Centos7 40 [OK]
......

Note the "docker.io: " prefix for the centos 7 name columns
http://rhelblog.redhat.com/2015/04/15/understanding-the-changes-to-docker-search-and-docker-pull-in-red-hat-enterprise-linux-7-1/
has details on why thats the case.

When you ask foreman-docker "search centos from docker hub", it gives
you different names based on whether the docker compute resource is
running on el7 or fedora 20. You then select an image and it shows the
tags for that. Based on your selections it picks "NAME" as the repo name
and chooses the tag. This works for docker compute instance running on
f20 and used to work for docker instance on el7.

Anyway problem is simple -> "docker.io: docker.io/centos" is not a valid
repo name. So foreman-docker has to somehow infer that
"docker.io/centos" is what the repo name should be and strip out
"docker.io: " while it should some how also work for
"my-other-registry.com:4000/cool-repo" and not strip out
"my-other-registry.com:4000".

This commit achieves to do that.

Also removing the hub_url code generation code because we'd need some
logic that converts docker.io/_/centos to
hub.registry.docker.com/_centos_/ and also work for rhel and regular
cases.

History

#1 Updated by Partha Aji over 7 years ago

Bug is easier stated this wat
on centos 7 ->

$ docker version
Client version: 1.5.0-dev
Client API version: 1.18
Go version (client): go1.3.3

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io: docker.io/centos The official build of CentOS. 978 [OK]
docker.io: docker.io/ansible/centos7-ansible Ansible on Centos7 40 [OK]
.....

On fedora 20 ->
$ docker version
Client version: 1.5.0
Client API version: 1.17

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 978 [OK]
ansible/centos7-ansible Ansible on Centos7 40 [OK]
......

Note the "docker.io: " prefix for the centos 7 name columns
http://rhelblog.redhat.com/2015/04/15/understanding-the-changes-to-docker-search-and-docker-pull-in-red-hat-enterprise-linux-7-1/ has details on why thats the case.

When you ask foreman-docker "search centos from docker hub", it gives you different names based on whether the docker compute resource is running on el7 or fedora 20. You then select an image and it shows the tags for that. Based on your selections it picks "NAME" as the repo name and chooses the tag. This works for docker compute instance running on f20 and used to work for docker instance on el7.

Anyway problem is simple -> "docker.io: docker.io/centos" is not a valid repo name. So foreman-docker has to somehow infer that "docker.io/centos" is what the repo name should be and strip out "docker.io: " while it should some how also work for "my-other-registry.com:4000/cool-repo" and not strip out "my-other-registry.com:4000".

#2 Updated by Partha Aji over 7 years ago

  • Assignee changed from Daniel Lobato Garcia to Partha Aji

#3 Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-docker/pull/113 added
  • Pull request deleted ()

#4 Updated by Eric Helms over 7 years ago

  • Project changed from Katello to Docker

#5 Updated by Partha Aji over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF