Skip to content

Commit

Permalink
allow use of host:port in a FROM instruction
Browse files Browse the repository at this point in the history
when having a FROM line like: `FROM myregistry:port/imagename:tag`, there is an error `unexpected ':' expecting '@', a new line followed by the next instruction, at least one space, or the image tag`.
This patch proposes to simplify how the registry is computed.
fixes: hadolint/hadolint#355

I don't know haskell, I tested the change by cloning the repo, and testing on a local file using the test in integration-tests
  • Loading branch information
petitlapin authored Oct 29, 2021
1 parent 57c2db8 commit 9518b6a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Language/Docker/Parser/From.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import Language.Docker.Syntax

parseRegistry :: (?esc :: Char) => Parser Registry
parseRegistry = do
domain <- someUnless "a domain name" (== '.')
void $ char '.'
tld <- someUnless "a TLD" (== '/')
registry <- someUnless "a registry" (== '/')
void $ char '/'
return $ Registry (domain <> "." <> tld)
return $ Registry (registry)

parsePlatform :: (?esc :: Char) => Parser Platform
parsePlatform = do
Expand Down

0 comments on commit 9518b6a

Please sign in to comment.