From 9518b6a84e175e4f0f4a78650676d3aa5b94c8a3 Mon Sep 17 00:00:00 2001 From: Johnny Jazeix Date: Fri, 29 Oct 2021 17:43:08 +0200 Subject: [PATCH] allow use of host:port in a FROM instruction 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: https://github.com/hadolint/hadolint/issues/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 --- src/Language/Docker/Parser/From.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Language/Docker/Parser/From.hs b/src/Language/Docker/Parser/From.hs index 1e14de1..13d1869 100644 --- a/src/Language/Docker/Parser/From.hs +++ b/src/Language/Docker/Parser/From.hs @@ -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