diff --git a/language-docker.cabal b/language-docker.cabal
--- a/language-docker.cabal
+++ b/language-docker.cabal
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 7a74d5326d2b97c11b2c1f412955004e681971bb5aa82c37173e2399c124c1bf
+-- hash: 4a0b653e5eb7e9efd296b2fbdca98b752a29af409fc0aad1b279ce43de280160
 
 name:           language-docker
-version:        8.0.1
+version:        8.0.2
 synopsis:       Dockerfile parser, pretty-printer and embedded DSL
 description:    All functions for parsing, printing and writting Dockerfiles are exported through @Language.Docker@. For more fine-grained operations look for specific modules that implement a certain functionality.
                 See the <https://github.com/hadolint/language-docker GitHub project> for the source-code and examples.
diff --git a/src/Language/Docker/Parser.hs b/src/Language/Docker/Parser.hs
--- a/src/Language/Docker/Parser.hs
+++ b/src/Language/Docker/Parser.hs
@@ -83,7 +83,7 @@
 natural = L.decimal <?> "positive number"
 
 commaSep :: Parser a -> Parser [a]
-commaSep p = sepBy p (symbol ",")
+commaSep p = sepBy (p <* spaces) (symbol ",")
 
 stringLiteral :: Parser Text
 stringLiteral = do
diff --git a/test/Language/Docker/ParserSpec.hs b/test/Language/Docker/ParserSpec.hs
--- a/test/Language/Docker/ParserSpec.hs
+++ b/test/Language/Docker/ParserSpec.hs
@@ -178,11 +178,15 @@
 
         describe "parse CMD" $ do
             it "one line cmd" $ assertAst "CMD true" [Cmd "true"]
+
             it "cmd over several lines" $
                 assertAst "CMD true \\\n && true" [Cmd "true  && true"]
+
             it "quoted command params" $ assertAst "CMD [\"echo\",  \"1\"]" [Cmd ["echo", "1"]]
 
-        describe "parse SHELL" $ do
+            it "Parses commas correctly" $ assertAst "CMD [ \"echo\" ,\"-e\" , \"1\"]" [Cmd ["echo", "-e", "1"]]
+
+        describe "parse SHELL" $
             it "quoted shell params" $
                 assertAst "SHELL [\"/bin/bash\",  \"-c\"]" [Shell ["/bin/bash", "-c"]]
 
