Back to Library
DevOps

Docker Image

Matches typical Docker image names.

Pattern
^(?:(?=[^:\/]{1,253})(?!-)[a-z0-9-]{1,63}(?<!-)(?:\.(?!-)[a-z0-9-]{1,63}(?<!-))*(?::[0-9]{1,5})?/)?((?![._-])(?:[a-z0-9._-]*)(?<![._-])(?:\/(?![._-])[a-z0-9._-]*(?<![._-]))*)(?::(?![.-])[a-zA-Z0-9_.-]{1,128})?$

Test Cases

nginx:latest Match
my-registry.com/my-app:v1 Match

Try it Live

Test and customize this pattern in our interactive editor

Open in Editor