Expand description
§Domain: host and an optional port
Parsers for the domain section of a reference:
docker.io/library/alpine:3.14
^^^^^^^^^
127.0.0.1:5000/registry/alpine:3.14
^^^^^^^^^^^^^^
The grammar for the domain section of a reference is:
domain ::= host (":" port-number)?
host ::= domain-name | IPv4address | "[" IPv6address "]" /* see https://www.rfc-editor.org/rfc/rfc3986#appendix-A */
domain-name ::= domain-component ("." domain-component)*
domain-component ::= ([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])
port-number ::= [0-9]+
Note that this DOES NOT allow for percent-encoded domain names. Thus,
we can’t use the url
crate for parsing domain names, since url::Host
strictly follows RFC 3986,
which allows decode percent-encoded domain names.
Structs§
- Domain
- The domain component of an image reference is composed of a host name or ip literal and an optional port number.
- Host
- An underscore-free host name or a bracketed IPv6 address.