Skip to content

Commit 2019b27

Browse files
authored
WX-1445 Update docker image regex to handle python:3 correctly (#7367)
1 parent f01c1f3 commit 2019b27

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

dockerHashing/src/main/scala/cromwell/docker/DockerImageIdentifier.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ object DockerImageIdentifier {
5656

5757
( # Begin capturing group for name
5858
[a-z0-9]+(?:[._-][a-z0-9]+)* # API v2 name component regex - see https://docs.docker.com/registry/spec/api/#/overview
59-
(?::[0-9]+)? # Optional port
59+
(?::[0-9]{4,5}|:443)? # Optional port (expect 4 or 5 digits OR :443)
6060
(?:/[a-z0-9]+(?:[._-][a-z0-9]+)*)* # Optional additional name components separated by /
6161
) # End capturing group for name
6262

dockerHashing/src/test/scala/cromwell/docker/DockerImageIdentifierSpec.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class DockerImageIdentifierSpec
4141
"0.8.1.1--htslib1.5_0"
4242
),
4343
("terrabatchdev.azurecr.io/postgres:latest", Option("terrabatchdev.azurecr.io"), None, "postgres", "latest"),
44+
("python:3", None, None, "python", "3"),
45+
("localhost:443/ubuntu", Option("localhost:443"), None, "ubuntu", "latest"),
4446
// Very long tags with trailing spaces cause problems for the re engine
4547
("someuser/someimage:supercalifragilisticexpialidociouseventhoughthesoundofitissomethingquiteatrociousifyousayitloudenoughyoullalwayssoundprecocious ",
4648
None,

0 commit comments

Comments
 (0)