Skip to content

Instantly share code, notes, and snippets.

@ccopsey
Last active November 4, 2021 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccopsey/5a78d4f301a160f3c95275cbf611602b to your computer and use it in GitHub Desktop.
Save ccopsey/5a78d4f301a160f3c95275cbf611602b to your computer and use it in GitHub Desktop.
Docker image name regex (https://regex101.com/r/1hJDEl/1)
^(?P<name>(?:(?:(?P<hostname>(?=[^:\/]{4,253})(?!-)[a-zA-Z0-9-]{1,63}(?<!-)(?:\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-))*)(?::(?P<port>[0-9]{1,5}))?)/)?(?P<registry>(?![._-])(?:[a-z0-9._-]*)(?<![._-])(?:/(?![._-])[a-z0-9._-]*(?<![._-]))*))(?::(?P<tag>(?![.-])[a-zA-Z0-9_.-]{1,128}))?(?:@sha256:(?P<digest>[a-f0-9]{64}))?$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment