RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1413310 - docker info always reports HTTPS and v1 for Registry even when first configured registry is insecure and v2
Summary: docker info always reports HTTPS and v1 for Registry even when first configur...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.3
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jindrich Novy
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1186913
TreeView+ depends on / blocked
 
Reported: 2017-01-14 19:27 UTC by Aron Parsons
Modified: 2021-06-10 11:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-28 19:42:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Aron Parsons 2017-01-14 19:27:12 UTC
Description of problem:
When passing an option of --add-registry to docker-latest, you can not specify a v2 registry.  It always appends /v1/ to the URI.

with just --add-registry=<host> passed:

[root@dkh01 ~]# grep add-registry /etc/sysconfig/docker-latest
OPTIONS=" -H unix:///var/run/docker.sock --ip-forward=true --iptables=true --ip-masq=true --fixed-cidr 172.16.16.0/22 --log-driver syslog --bip=172.16.16.1/22  --add-registry=docker.knack.works --selinux-enabled --disable-legacy-registry=true"

[root@dkh01 ~]# ps ax | grep dockerd
11379 ?        Sl     0:02 /usr/bin/dockerd-latest -H unix:///var/run/docker.sock --ip-forward=true --iptables=true --ip-masq=true --fixed-cidr 172.16.16.0/22 --log-driver syslog --bip=172.16.16.1/22 --add-registry=docker.knack.works --selinux-enabled --disable-legacy-registry=true --exec-opt native.cgroupdriver=systemd --storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=/dev/mapper/docker-docker--latest--pool --storage-opt dm.use_deferred_removal=true --storage-opt dm.use_deferred_deletion=true

[root@dkh01 ~]# docker info | grep Registry
Registry: https://docker.knack.works/v1/


attempting to workaround with appending /v2/:

[root@dkh01 ~]# ps ax | grep dockerd
12281 ?        Sl     0:02 /usr/bin/dockerd-latest -H unix:///var/run/docker.sock --ip-forward=true --iptables=true --ip-masq=true --fixed-cidr 172.16.16.0/22 --log-driver syslog --bip=172.16.16.1/22 --add-registry=docker.knack.works/v2/ --selinux-enabled --disable-legacy-registry=true --exec-opt native.cgroupdriver=systemd --storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=/dev/mapper/docker-docker--latest--pool --storage-opt dm.use_deferred_removal=true --storage-opt dm.use_deferred_deletion=true

[root@dkh01 ~]# ps ax | grep dockerd
12280 ?        Ss     0:00 /bin/sh -c /usr/bin/dockerd-latest $OPTIONS        --exec-opt native.cgroupdriver=systemd        $DOCKER_STORAGE_OPTIONS        $DOCKER_NETWORK_OPTIONS        $BLOCK_REGISTRY        $INSECURE_REGISTRY        2>&1 | /usr/bin/forward-journald -tag docker
12281 ?        Sl     0:02 /usr/bin/dockerd-latest -H unix:///var/run/docker.sock --ip-forward=true --iptables=true --ip-masq=true --fixed-cidr 172.16.16.0/22 --log-driver syslog --bip=172.16.16.1/22 --add-registry=docker.knack.works/v2/ --selinux-enabled --disable-legacy-registry=true --exec-opt native.cgroupdriver=systemd --storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=/dev/mapper/docker-docker--latest--pool --storage-opt dm.use_deferred_removal=true --storage-opt dm.use_deferred_deletion=true
12557 pts/0    S+     0:00 grep --color=auto dockerd

[root@dkh01 ~]# docker info | grep Registry
Registry: https://docker.knack.works/v2//v1/


Version-Release number of selected component (if applicable):
docker-latest-1.12.3-10.el7.x86_64


How reproducible:
always


Steps to Reproduce:
1. append --add-registry=<host>/v2/ option in /etc/sysconfig/docker-latest
2. restart docker-latest service
3. attempt to access a v2 registry as the default registry

Actual results:
fails to access registry

Expected results:
able to pull images from the registry

Comment 2 Derrick Ornelas 2018-02-05 23:25:32 UTC
I'm fairly positive this is just a display issue at this point.  Aron, can you confirm that if you specify "--add-registry=docker.knack.works" (or, better yet, use /etc/containers/registries.conf) with docker 1.12.6 or docker-latest 1.13.1 that you can pull from your v2 registry even though the docker daemon reports:

  Registry: https://docker.knack.works/v1/


Here's a test:

# rpm -q docker-latest
docker-latest-1.13.1-37.git9a813fa.el7.x86_64


# grep -A1 "\[registries.search\]" /etc/containers/registries.conf 
[registries.search]
registries = ['myregistry.example.redhat.com:5000','registry.access.redhat.com']


# curl -w "%{http_code}\n" http://myregistry.example.redhat.com:5000/v1/_ping
404 page not found
404

# curl -w "%{http_code}\n" http://myregistry.example.redhat.com:5000/v2/
{}200

* This is a docker-distribution v2 registry that dosen't support v1


# docker info | grep -A6 Registry
  WARNING: You're not using the default seccomp profile
Registry: https://myregistry.example.redhat.com:5000/v1/
Experimental: false
Insecure Registries:
 myregistry.example.redhat.com:5000
 127.0.0.0/8
Live Restore Enabled: false
Registries: myregistry.example.redhat.com:5000 (insecure), registry.access.redhat.com (secure), docker.io (secure)

* It's still reported as v1 and HTTPS even though it's neither


# docker pull myregistry.example.redhat.com:5000/rhel72
Using default tag: latest
Trying to pull repository myregistry.example.redhat.com:5000/rhel72 ... 
latest: Pulling from myregistry.example.redhat.com:5000/rhel72
60555de892ec: Pull complete 
Digest: sha256:bf54eba0767f4cfd65f37555899f1067e27fc5ed0f63513f37a8258f48e87eb3
Status: Downloaded newer image for myregistry.example.redhat.com:5000/rhel72:latest

* Daemon still correctly pulls via v2 and HTTP

Comment 3 Aron Parsons 2018-03-05 14:09:37 UTC
Derrick,
Confirm that this is just a display issue.  Adding the registry allows pulling without prefixing the registry hostname as the first component.

Comment 4 Derrick Ornelas 2018-03-05 16:03:34 UTC
Aron, thanks for the confirmation.

Comment 6 Derrick Ornelas 2020-02-28 19:42:29 UTC
The Red Hat Enterprise Linux 7 life cycle has entered Maintenance Support 1 Phase, which means that only qualified Critical and Important Security errata advisories (RHSAs) and some Urgent Priority Bug Fix errata advisories (RHBAs) will be released as they become available.  Unfortunately, this issue was not selected to be included in Red Hat Enterprise Linux 7, because it is seen either as low or moderate impact to a small number of use-cases. We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise, we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.

See the Red Hat Enterprise Linux Life Cycle for more details:
https://access.redhat.com/support/policy/updates/errata/#Maintenance_Support_1_Phase


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