Skip to content

Conversation

JimmyMa
Copy link

@JimmyMa JimmyMa commented Jun 23, 2025

Fixes issue

Docker supports IPv6 address, for example: docker pull [fddd:1222:1222:1222::ac29:5a6a]:5000/test/test:latest , but regclient doesn't support it.

Describe the change

Changed types/ref/ref.go to parse IPv6 address, with this change the regctl supports IPv6 host as below:

regctl registry set [fddd:1222:1222:1222::ac29:5a6a]:443 --tls insecure
regctl registry set [fddd:1222:1222:1222::ac29:5a6a] --tls insecure
regctl repo list  [fddd:1222:1222:1222::ac29:5a6a]:443
regctl tag ls [fddd:1222:1222:1222::ac29:5a6a]/red/core
regctl image inspect [fddd:1222:1222:1222::ac29:5a6a]:443/test/test:latest

How to verify it

  1. Create a VM with IPv6
  2. Create a local registry: docker run -d -p 5000:5000 --restart always --name registry registry:2
  3. Run regctl against the IPv6 address of the local registry

Changelog text

  • Feat: Support IPv6 hosts.

Please verify and check that the pull request fulfills the following requirements

  • Tests have been added or not applicable
  • Documentation has been added, updated, or not applicable
  • Changes have been rebased to main
  • Multiple commits to the same code have been squashed

Signed-off-by: Yun Feng Ma <yma@ddn.com>
@sudo-bmitch
Copy link
Contributor

Thanks, IPv6 support is certainly desired.

Looking at the distribution implementation, I'm seeing the following: distribution/reference@992adca

There's a bit of cleanup and reorg in the regexp needed in here. I'll follow up with some adjustments.

@sudo-bmitch sudo-bmitch self-assigned this Jun 23, 2025
This moves the port to a standalone piece that is appended to various registry syntaxes.
This also makes the IPv6 matching more strict on allowing "::" only in one part of the expression.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with changes. Let me know if the edits give you any issues.

@sudo-bmitch sudo-bmitch merged commit 58c2b2e into regclient:main Jun 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants