-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Dockerfile parser, pretty-printer and embedded DSL
--   
--   All functions for parsing, printing and writting Dockerfiles are
--   exported through <tt>Language.Docker</tt>. For more fine-grained
--   operations look for specific modules that implement a certain
--   functionality. See the <a>GitHub project</a> for the source-code and
--   examples.
@package language-docker
@version 8.0.2

module Language.Docker.Normalize

-- | Remove new line escapes and join escaped lines together on one line to
--   simplify parsing later on. Escapes are replaced with line breaks to
--   not alter the line numbers.
normalizeEscapedLines :: Text -> Text

module Language.Docker.Syntax
data Image
Image :: !Maybe Registry -> !Text -> Image
[$sel:registryName:Image] :: Image -> !Maybe Registry
[$sel:imageName:Image] :: Image -> !Text
newtype Registry
Registry :: Text -> Registry
[$sel:unRegistry:Registry] :: Registry -> Text
newtype Tag
Tag :: Text -> Tag
[$sel:unTag:Tag] :: Tag -> Text
newtype Digest
Digest :: Text -> Digest
[$sel:unDigest:Digest] :: Digest -> Text
data Protocol
TCP :: Protocol
UDP :: Protocol
data Port
Port :: !Int -> !Protocol -> Port
PortStr :: !Text -> Port
PortRange :: !Int -> !Int -> !Protocol -> Port
newtype Ports
Ports :: [Port] -> Ports
[$sel:unPorts:Ports] :: Ports -> [Port]
type Directory = Text
type Platform = Text
newtype ImageAlias
ImageAlias :: Text -> ImageAlias
[$sel:unImageAlias:ImageAlias] :: ImageAlias -> Text
data BaseImage
BaseImage :: !Image -> !Maybe Tag -> !Maybe Digest -> !Maybe ImageAlias -> !Maybe Platform -> BaseImage
[$sel:image:BaseImage] :: BaseImage -> !Image
[$sel:tag:BaseImage] :: BaseImage -> !Maybe Tag
[$sel:digest:BaseImage] :: BaseImage -> !Maybe Digest
[$sel:alias:BaseImage] :: BaseImage -> !Maybe ImageAlias
[$sel:platform:BaseImage] :: BaseImage -> !Maybe Platform

-- | Type of the Dockerfile AST
type Dockerfile = [InstructionPos Text]
newtype SourcePath
SourcePath :: Text -> SourcePath
[$sel:unSourcePath:SourcePath] :: SourcePath -> Text
newtype TargetPath
TargetPath :: Text -> TargetPath
[$sel:unTargetPath:TargetPath] :: TargetPath -> Text
data Chown
Chown :: !Text -> Chown
NoChown :: Chown
data CopySource
CopySource :: !Text -> CopySource
NoSource :: CopySource
newtype Duration
Duration :: DiffTime -> Duration
[$sel:durationTime:Duration] :: Duration -> DiffTime
newtype Retries
Retries :: Int -> Retries
[$sel:times:Retries] :: Retries -> Int
data CopyArgs
CopyArgs :: NonEmpty SourcePath -> !TargetPath -> !Chown -> !CopySource -> CopyArgs
[$sel:sourcePaths:CopyArgs] :: CopyArgs -> NonEmpty SourcePath
[$sel:targetPath:CopyArgs] :: CopyArgs -> !TargetPath
[$sel:chownFlag:CopyArgs] :: CopyArgs -> !Chown
[$sel:sourceFlag:CopyArgs] :: CopyArgs -> !CopySource
data AddArgs
AddArgs :: NonEmpty SourcePath -> !TargetPath -> !Chown -> AddArgs
[$sel:sourcePaths:AddArgs] :: AddArgs -> NonEmpty SourcePath
[$sel:targetPath:AddArgs] :: AddArgs -> !TargetPath
[$sel:chownFlag:AddArgs] :: AddArgs -> !Chown
data Check args
Check :: !CheckArgs args -> Check args
NoCheck :: Check args
data Arguments args
ArgumentsText :: args -> Arguments args
ArgumentsList :: args -> Arguments args
data CheckArgs args
CheckArgs :: !Arguments args -> !Maybe Duration -> !Maybe Duration -> !Maybe Duration -> !Maybe Retries -> CheckArgs args
[$sel:checkCommand:CheckArgs] :: CheckArgs args -> !Arguments args
[$sel:interval:CheckArgs] :: CheckArgs args -> !Maybe Duration
[$sel:timeout:CheckArgs] :: CheckArgs args -> !Maybe Duration
[$sel:startPeriod:CheckArgs] :: CheckArgs args -> !Maybe Duration
[$sel:retries:CheckArgs] :: CheckArgs args -> !Maybe Retries
type Pairs = [(Text, Text)]

-- | All commands available in Dockerfiles
data Instruction args
From :: !BaseImage -> Instruction args
Add :: !AddArgs -> Instruction args
User :: !Text -> Instruction args
Label :: !Pairs -> Instruction args
Stopsignal :: !Text -> Instruction args
Copy :: !CopyArgs -> Instruction args
Run :: !Arguments args -> Instruction args
Cmd :: !Arguments args -> Instruction args
Shell :: !Arguments args -> Instruction args
Workdir :: !Directory -> Instruction args
Expose :: !Ports -> Instruction args
Volume :: !Text -> Instruction args
Entrypoint :: !Arguments args -> Instruction args
Maintainer :: !Text -> Instruction args
Env :: !Pairs -> Instruction args
Arg :: !Text -> !Maybe Text -> Instruction args
Healthcheck :: !Check args -> Instruction args
Comment :: !Text -> Instruction args
OnBuild :: !Instruction args -> Instruction args
type Filename = Text
type Linenumber = Int

-- | <a>Instruction</a> with additional location information required for
--   creating good check messages
data InstructionPos args
InstructionPos :: !Instruction args -> !Filename -> !Linenumber -> InstructionPos args
[$sel:instruction:InstructionPos] :: InstructionPos args -> !Instruction args
[$sel:sourcename:InstructionPos] :: InstructionPos args -> !Filename
[$sel:lineNumber:InstructionPos] :: InstructionPos args -> !Linenumber
instance GHC.Base.Functor Language.Docker.Syntax.InstructionPos
instance GHC.Show.Show args => GHC.Show.Show (Language.Docker.Syntax.InstructionPos args)
instance GHC.Classes.Ord args => GHC.Classes.Ord (Language.Docker.Syntax.InstructionPos args)
instance GHC.Classes.Eq args => GHC.Classes.Eq (Language.Docker.Syntax.InstructionPos args)
instance GHC.Base.Functor Language.Docker.Syntax.Instruction
instance GHC.Show.Show args => GHC.Show.Show (Language.Docker.Syntax.Instruction args)
instance GHC.Classes.Ord args => GHC.Classes.Ord (Language.Docker.Syntax.Instruction args)
instance GHC.Classes.Eq args => GHC.Classes.Eq (Language.Docker.Syntax.Instruction args)
instance GHC.Base.Functor Language.Docker.Syntax.Check
instance GHC.Classes.Ord args => GHC.Classes.Ord (Language.Docker.Syntax.Check args)
instance GHC.Classes.Eq args => GHC.Classes.Eq (Language.Docker.Syntax.Check args)
instance GHC.Show.Show args => GHC.Show.Show (Language.Docker.Syntax.Check args)
instance GHC.Base.Functor Language.Docker.Syntax.CheckArgs
instance GHC.Classes.Ord args => GHC.Classes.Ord (Language.Docker.Syntax.CheckArgs args)
instance GHC.Classes.Eq args => GHC.Classes.Eq (Language.Docker.Syntax.CheckArgs args)
instance GHC.Show.Show args => GHC.Show.Show (Language.Docker.Syntax.CheckArgs args)
instance GHC.Base.Functor Language.Docker.Syntax.Arguments
instance GHC.Classes.Ord args => GHC.Classes.Ord (Language.Docker.Syntax.Arguments args)
instance GHC.Classes.Eq args => GHC.Classes.Eq (Language.Docker.Syntax.Arguments args)
instance GHC.Show.Show args => GHC.Show.Show (Language.Docker.Syntax.Arguments args)
instance GHC.Classes.Ord Language.Docker.Syntax.AddArgs
instance GHC.Classes.Eq Language.Docker.Syntax.AddArgs
instance GHC.Show.Show Language.Docker.Syntax.AddArgs
instance GHC.Classes.Ord Language.Docker.Syntax.CopyArgs
instance GHC.Classes.Eq Language.Docker.Syntax.CopyArgs
instance GHC.Show.Show Language.Docker.Syntax.CopyArgs
instance GHC.Num.Num Language.Docker.Syntax.Retries
instance GHC.Classes.Ord Language.Docker.Syntax.Retries
instance GHC.Classes.Eq Language.Docker.Syntax.Retries
instance GHC.Show.Show Language.Docker.Syntax.Retries
instance GHC.Num.Num Language.Docker.Syntax.Duration
instance GHC.Classes.Ord Language.Docker.Syntax.Duration
instance GHC.Classes.Eq Language.Docker.Syntax.Duration
instance GHC.Show.Show Language.Docker.Syntax.Duration
instance GHC.Classes.Ord Language.Docker.Syntax.CopySource
instance GHC.Classes.Eq Language.Docker.Syntax.CopySource
instance GHC.Show.Show Language.Docker.Syntax.CopySource
instance GHC.Classes.Ord Language.Docker.Syntax.Chown
instance GHC.Classes.Eq Language.Docker.Syntax.Chown
instance GHC.Show.Show Language.Docker.Syntax.Chown
instance Data.String.IsString Language.Docker.Syntax.TargetPath
instance GHC.Classes.Ord Language.Docker.Syntax.TargetPath
instance GHC.Classes.Eq Language.Docker.Syntax.TargetPath
instance GHC.Show.Show Language.Docker.Syntax.TargetPath
instance Data.String.IsString Language.Docker.Syntax.SourcePath
instance GHC.Classes.Ord Language.Docker.Syntax.SourcePath
instance GHC.Classes.Eq Language.Docker.Syntax.SourcePath
instance GHC.Show.Show Language.Docker.Syntax.SourcePath
instance GHC.Show.Show Language.Docker.Syntax.BaseImage
instance GHC.Classes.Ord Language.Docker.Syntax.BaseImage
instance GHC.Classes.Eq Language.Docker.Syntax.BaseImage
instance Data.String.IsString Language.Docker.Syntax.ImageAlias
instance GHC.Classes.Ord Language.Docker.Syntax.ImageAlias
instance GHC.Classes.Eq Language.Docker.Syntax.ImageAlias
instance GHC.Show.Show Language.Docker.Syntax.ImageAlias
instance GHC.Classes.Ord Language.Docker.Syntax.Ports
instance GHC.Classes.Eq Language.Docker.Syntax.Ports
instance GHC.Show.Show Language.Docker.Syntax.Ports
instance GHC.Classes.Ord Language.Docker.Syntax.Port
instance GHC.Classes.Eq Language.Docker.Syntax.Port
instance GHC.Show.Show Language.Docker.Syntax.Port
instance GHC.Classes.Ord Language.Docker.Syntax.Protocol
instance GHC.Classes.Eq Language.Docker.Syntax.Protocol
instance GHC.Show.Show Language.Docker.Syntax.Protocol
instance Data.String.IsString Language.Docker.Syntax.Digest
instance GHC.Classes.Ord Language.Docker.Syntax.Digest
instance GHC.Classes.Eq Language.Docker.Syntax.Digest
instance GHC.Show.Show Language.Docker.Syntax.Digest
instance Data.String.IsString Language.Docker.Syntax.Tag
instance GHC.Classes.Ord Language.Docker.Syntax.Tag
instance GHC.Classes.Eq Language.Docker.Syntax.Tag
instance GHC.Show.Show Language.Docker.Syntax.Tag
instance GHC.Classes.Ord Language.Docker.Syntax.Image
instance GHC.Classes.Eq Language.Docker.Syntax.Image
instance GHC.Show.Show Language.Docker.Syntax.Image
instance Data.String.IsString Language.Docker.Syntax.Registry
instance GHC.Classes.Ord Language.Docker.Syntax.Registry
instance GHC.Classes.Eq Language.Docker.Syntax.Registry
instance GHC.Show.Show Language.Docker.Syntax.Registry
instance Data.String.IsString (Language.Docker.Syntax.Arguments Data.Text.Internal.Text)
instance GHC.Exts.IsList (Language.Docker.Syntax.Arguments Data.Text.Internal.Text)
instance Data.String.IsString Language.Docker.Syntax.CopySource
instance Data.String.IsString Language.Docker.Syntax.Chown
instance GHC.Exts.IsList Language.Docker.Syntax.Ports
instance Data.String.IsString Language.Docker.Syntax.Image

module Language.Docker.PrettyPrint
data EscapeAccum
EscapeAccum :: !Builder -> !Int -> !Bool -> EscapeAccum
[$sel:buffer:EscapeAccum] :: EscapeAccum -> !Builder
[$sel:count:EscapeAccum] :: EscapeAccum -> !Int
[$sel:escaping:EscapeAccum] :: EscapeAccum -> !Bool

-- | Pretty print a <a>Dockerfile</a> to a <a>Text</a>
prettyPrint :: Dockerfile -> Text
prettyPrintDockerfile :: Pretty (Arguments args) => [InstructionPos args] -> Doc ann

-- | Pretty print a <a>InstructionPos</a> to a <a>Doc</a>
prettyPrintInstructionPos :: Pretty (Arguments args) => InstructionPos args -> Doc ann
prettyPrintImage :: Image -> Doc ann
prettyPrintBaseImage :: BaseImage -> Doc ann
prettyPrintPairs :: Pairs -> Doc ann
prettyPrintPair :: (Text, Text) -> Doc ann
prettyPrintArguments :: Arguments Text -> Doc ann
prettyPrintJSON :: [Text] -> Doc ann
doubleQoute :: Text -> Doc ann
escapeQuotes :: Text -> Text
prettyPrintPort :: Port -> Doc ann
prettyPrintFileList :: NonEmpty SourcePath -> TargetPath -> Doc ann
prettyPrintChown :: Chown -> Doc ann
prettyPrintCopySource :: CopySource -> Doc ann
prettyPrintDuration :: Text -> Maybe Duration -> Doc ann
prettyPrintRetries :: Maybe Retries -> Doc ann
prettyPrintInstruction :: Pretty (Arguments args) => Instruction args -> Doc ann
spaceCat :: Doc ann -> Doc ann -> Doc ann
instance Data.Text.Prettyprint.Doc.Internal.Pretty (Language.Docker.Syntax.Arguments Data.Text.Internal.Text)

module Language.Docker.Parser
parseText :: Text -> Either Error Dockerfile
parseFile :: FilePath -> IO (Either Error Dockerfile)

-- | Reads the standard input until the end and parses the contents as a
--   Dockerfile
parseStdin :: IO (Either Error Dockerfile)
type Parser = Parsec DockerfileError Text
type Error = ParseErrorBundle Text DockerfileError
data DockerfileError
DuplicateFlagError :: String -> DockerfileError
NoValueFlagError :: String -> DockerfileError
InvalidFlagError :: String -> DockerfileError
FileListError :: String -> DockerfileError
QuoteError :: String -> String -> DockerfileError
instance GHC.Show.Show Language.Docker.Parser.DockerfileError
instance GHC.Read.Read Language.Docker.Parser.DockerfileError
instance GHC.Classes.Ord Language.Docker.Parser.DockerfileError
instance Data.Data.Data Language.Docker.Parser.DockerfileError
instance GHC.Classes.Eq Language.Docker.Parser.DockerfileError
instance Text.Megaparsec.Error.ShowErrorComponent Language.Docker.Parser.DockerfileError

module Language.Docker.EDSL.Types
data EBaseImage
EBaseImage :: Image -> Maybe Tag -> Maybe Digest -> Maybe ImageAlias -> Maybe Platform -> EBaseImage
data EInstruction next
From :: EBaseImage -> next -> EInstruction next
AddArgs :: NonEmpty SourcePath -> TargetPath -> Chown -> next -> EInstruction next
User :: Text -> next -> EInstruction next
Label :: Pairs -> next -> EInstruction next
StopSignal :: Text -> next -> EInstruction next
CopyArgs :: NonEmpty SourcePath -> TargetPath -> Chown -> CopySource -> next -> EInstruction next
RunArgs :: Arguments Text -> next -> EInstruction next
CmdArgs :: Arguments Text -> next -> EInstruction next
Shell :: Arguments Text -> next -> EInstruction next
Workdir :: Directory -> next -> EInstruction next
Expose :: Ports -> next -> EInstruction next
Volume :: Text -> next -> EInstruction next
EntrypointArgs :: Arguments Text -> next -> EInstruction next
Maintainer :: Text -> next -> EInstruction next
Env :: Pairs -> next -> EInstruction next
Arg :: Text -> Maybe Text -> next -> EInstruction next
Comment :: Text -> next -> EInstruction next
Healthcheck :: Check Text -> next -> EInstruction next
OnBuildRaw :: Instruction Text -> next -> EInstruction next
Embed :: [InstructionPos Text] -> next -> EInstruction next
instance GHC.Base.Functor Language.Docker.EDSL.Types.EInstruction
instance GHC.Classes.Ord Language.Docker.EDSL.Types.EBaseImage
instance GHC.Classes.Eq Language.Docker.EDSL.Types.EBaseImage
instance GHC.Show.Show Language.Docker.EDSL.Types.EBaseImage
instance Data.String.IsString Language.Docker.EDSL.Types.EBaseImage

module Language.Docker.EDSL

-- | The type of <tt>Identity</tt> based EDSL blocks
type EDockerfileM = Free EInstruction

-- | The type of free monad EDSL blocks
type EDockerfileTM = FreeT EInstruction
type EInstructionM = Free EInstruction
type EInstructionTM = FreeT EInstruction
embed :: forall m_aTqe. MonadFree EInstruction m_aTqe => [InstructionPos Text] -> m_aTqe ()
onBuildRaw :: forall m_aTqb. MonadFree EInstruction m_aTqb => Instruction Text -> m_aTqb ()
healthcheck :: forall m_aTq8. MonadFree EInstruction m_aTq8 => Check Text -> m_aTq8 ()
comment :: forall m_aTq5. MonadFree EInstruction m_aTq5 => Text -> m_aTq5 ()
arg :: forall m_aTq1. MonadFree EInstruction m_aTq1 => Text -> Maybe Text -> m_aTq1 ()
env :: forall m_aTpY. MonadFree EInstruction m_aTpY => Pairs -> m_aTpY ()
maintainer :: forall m_aTpV. MonadFree EInstruction m_aTpV => Text -> m_aTpV ()
entrypointArgs :: forall m_aTpS. MonadFree EInstruction m_aTpS => Arguments Text -> m_aTpS ()
volume :: forall m_aTpP. MonadFree EInstruction m_aTpP => Text -> m_aTpP ()
expose :: forall m_aTpM. MonadFree EInstruction m_aTpM => Ports -> m_aTpM ()
workdir :: forall m_aTpJ. MonadFree EInstruction m_aTpJ => Directory -> m_aTpJ ()
shell :: forall m_aTpG. MonadFree EInstruction m_aTpG => Arguments Text -> m_aTpG ()
cmdArgs :: forall m_aTpD. MonadFree EInstruction m_aTpD => Arguments Text -> m_aTpD ()
runArgs :: forall m_aTpA. MonadFree EInstruction m_aTpA => Arguments Text -> m_aTpA ()
copyArgs :: forall m_aTpu. MonadFree EInstruction m_aTpu => NonEmpty SourcePath -> TargetPath -> Chown -> CopySource -> m_aTpu ()
stopSignal :: forall m_aTpr. MonadFree EInstruction m_aTpr => Text -> m_aTpr ()
label :: forall m_aTpo. MonadFree EInstruction m_aTpo => Pairs -> m_aTpo ()
user :: forall m_aTpl. MonadFree EInstruction m_aTpl => Text -> m_aTpl ()
addArgs :: forall m_aTpg. MonadFree EInstruction m_aTpg => NonEmpty SourcePath -> TargetPath -> Chown -> m_aTpg ()
from :: forall m_aTnx. MonadFree EInstruction m_aTnx => EBaseImage -> m_aTnx ()
runDockerWriter :: MonadWriter [Instruction Text] m => EDockerfileM a -> m a
runDockerWriterIO :: (Monad m, MonadTrans t, MonadWriter [Instruction Text] (t m)) => EDockerfileTM m a -> t m a
runDef :: MonadWriter [t] m => (t1 -> t) -> t1 -> m b -> m b
runDef2 :: MonadWriter [t] m => (t1 -> t2 -> t) -> t1 -> t2 -> m b -> m b
runD :: MonadWriter [Instruction Text] m => EInstruction (m b) -> m b
instructionPos :: Instruction args -> InstructionPos args

-- | Runs the Dockerfile EDSL and returns a <tt>Dockerfile</tt> you can
--   pretty print or manipulate
toDockerfile :: EDockerfileM a -> Dockerfile

-- | runs the Dockerfile EDSL and returns a <a>Lazy</a> using
--   <a>PrettyPrint</a>
--   
--   <pre>
--   import Language.Docker
--   
--   main :: IO ()
--   main = print $ toDockerfileText $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "<i>app</i>language-docker"
--       workdir "<i>app</i>language-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   </pre>
toDockerfileText :: EDockerfileM a -> Text

-- | Writes the dockerfile to the given file path after pretty-printing it
--   
--   <pre>
--   import Language.Docker
--   
--   main :: IO ()
--   main = writeDockerFile "build.Dockerfile" $ toDockerfile $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "<i>app</i>language-docker"
--       workdir "<i>app</i>language-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   </pre>
writeDockerFile :: Text -> Dockerfile -> IO ()

-- | Prints the dockerfile to stdout. Mainly used for debugging purposes
--   
--   <pre>
--   import Language.Docker
--   
--   main :: IO ()
--   main = putDockerfileStr $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "<i>app</i>language-docker"
--       workdir "<i>app</i>language-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   </pre>
putDockerfileStr :: EDockerfileM a -> IO ()

-- | Use a docker image in a FROM instruction without a tag
--   
--   The following two examples are equivalent
--   
--   <pre>
--   from $ untagged "fpco/stack-build"
--   </pre>
--   
--   Is equivalent to, when having OverloadedStrings:
--   
--   <pre>
--   from "fpco/stack-build"
--   </pre>
untagged :: Text -> EBaseImage

-- | Use a specific tag for a docker image. This function is meant to be
--   used as an infix operator.
--   
--   <pre>
--   from $ "fpco/stack-build" <a>tagged</a> "lts-10.3"
--   </pre>
tagged :: Image -> Tag -> EBaseImage

-- | Adds a digest checksum so a FROM instruction This function is meant to
--   be used as an infix operator.
--   
--   <pre>
--   from $ "fpco/stack-build" <a>digested</a> "sha256:abcdef123"
--   </pre>
digested :: EBaseImage -> Digest -> EBaseImage

-- | Alias a FROM instruction to be used as a build stage. This function is
--   meant to be used as an infix operator.
--   
--   <pre>
--   from $ "fpco/stack-build" <a>aliased</a> "builder"
--   </pre>
aliased :: EBaseImage -> ImageAlias -> EBaseImage

-- | Create a RUN instruction with the given arguments.
--   
--   <pre>
--   run "apt-get install wget"
--   </pre>
run :: MonadFree EInstruction m => Arguments Text -> m ()

-- | Create an ENTRYPOINT instruction with the given arguments.
--   
--   <pre>
--   entrypoint "<i>usr</i>local<i>bin</i>program --some-flag"
--   </pre>
entrypoint :: MonadFree EInstruction m => Arguments Text -> m ()

-- | Create a CMD instruction with the given arguments.
--   
--   <pre>
--   cmd "my-program --some-flag"
--   </pre>
cmd :: MonadFree EInstruction m => Arguments Text -> m ()

-- | Create a COPY instruction. This function is meant to be used with the
--   compinators <a>to</a>, <a>fromStage</a> and <a>ownedBy</a>
--   
--   <pre>
--   copy $ ["foo.js", "bar.js"] <a>to</a> "."
--   copy $ ["some_file"] <a>to</a> "<i>some</i>path" <a>fromStage</a> "builder"
--   </pre>
copy :: MonadFree EInstruction m => CopyArgs -> m ()

-- | Create a COPY instruction from a given build stage. This is a
--   shorthand version of using <a>copy</a> with combinators.
--   
--   <pre>
--   copyFromStage "builder" ["foo.js", "bar.js"] "."
--   </pre>
copyFromStage :: MonadFree EInstruction m => CopySource -> NonEmpty SourcePath -> TargetPath -> m ()

-- | Create an ADD instruction. This is often used as a shorthand version
--   of copy when no extra options are needed. Currently there is no way to
--   pass extra options to ADD, so you are encouraged to use <a>copy</a>
--   instead.
--   
--   <pre>
--   add ["foo.js", "bar.js"] "."
--   </pre>
add :: MonadFree EInstruction m => NonEmpty SourcePath -> TargetPath -> m ()

-- | Converts a NonEmpty list of strings to a NonEmpty list of
--   <a>SourcePath</a>
--   
--   This is a convenience function when you need to pass a non-static list
--   of strings that you build somewhere as an argument for <a>copy</a> or
--   <a>add</a>
--   
--   <pre>
--   someFiles &lt;- glob "*.js"
--   copy $ (toSources someFiles) <a>to</a> "."
--   </pre>
toSources :: NonEmpty Text -> NonEmpty SourcePath

-- | Converts a Text into a <a>TargetPath</a>
--   
--   This is a convenience function when you need to pass a string variable
--   as an argument for <a>copy</a> or <a>add</a>
--   
--   <pre>
--   let destination = buildSomePath pwd
--   add ["foo.js"] (toTarget destination)
--   </pre>
toTarget :: Text -> TargetPath

-- | Adds the --from= option to a COPY instruction.
--   
--   This function is meant to be used as an infix operator:
--   
--   <pre>
--   copy $ ["foo.js"] <a>to</a> "." <a>fromStage</a> "builder"
--   </pre>
fromStage :: CopyArgs -> CopySource -> CopyArgs

-- | Adds the --chown= option to a COPY instruction.
--   
--   This function is meant to be used as an infix operator:
--   
--   <pre>
--   copy $ ["foo.js"] <a>to</a> "." <a>ownedBy</a> "www-data:www-data"
--   </pre>
ownedBy :: CopyArgs -> Chown -> CopyArgs

-- | Usedto join source paths with atarget path as an arguments for
--   <a>copy</a>
--   
--   This function is meant to be used as an infix operator:
--   
--   <pre>
--   copy $ ["foo.js"] <a>to</a> "." <a>ownedBy</a>
--   </pre>
to :: NonEmpty SourcePath -> TargetPath -> CopyArgs
ports :: [Port] -> Ports
tcpPort :: Int -> Port
udpPort :: Int -> Port
variablePort :: Text -> Port
portRange :: Int -> Int -> Port
udpPortRange :: Int -> Int -> Port
check :: Arguments args -> Check args
interval :: Check args -> Integer -> Check args
timeout :: Check args -> Integer -> Check args
startPeriod :: Check args -> Integer -> Check args
retries :: Check args -> Integer -> Check args
noCheck :: Check args

-- | ONBUILD Dockerfile instruction
--   
--   Each nested instruction gets emitted as a separate <tt>ONBUILD</tt>
--   block
--   
--   <pre>
--   <a>toDockerfile</a> $ do
--       from "node"
--       run "apt-get update"
--       onBuild $ do
--           run "echo more-stuff"
--           run "echo here"
--   </pre>
onBuild :: MonadFree EInstruction m => EDockerfileM a -> m ()

-- | A version of <a>toDockerfile</a> which allows IO actions
toDockerfileIO :: MonadIO m => EDockerfileTM m t -> m Dockerfile

-- | A version of <a>toDockerfileText</a> which allows IO actions
toDockerfileTextIO :: MonadIO m => EDockerfileTM m t -> m Text

-- | Just runs the EDSL's writer monad
runDockerfileIO :: MonadIO m => EDockerfileTM m t -> m (t, Dockerfile)

-- | Runs the EDSL's writer monad and pretty-prints the result
runDockerfileTextIO :: MonadIO m => EDockerfileTM m t -> m (t, Text)

module Language.Docker.Syntax.Lift
instance Language.Haskell.TH.Syntax.Lift args => Language.Haskell.TH.Syntax.Lift (Language.Docker.Syntax.Check args)
instance Language.Haskell.TH.Syntax.Lift args => Language.Haskell.TH.Syntax.Lift (Language.Docker.Syntax.CheckArgs args)
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Retries
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Duration
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.AddArgs
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.CopyArgs
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.CopySource
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Chown
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.TargetPath
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.SourcePath
instance Language.Haskell.TH.Syntax.Lift args => Language.Haskell.TH.Syntax.Lift (Language.Docker.Syntax.InstructionPos args)
instance Language.Haskell.TH.Syntax.Lift args => Language.Haskell.TH.Syntax.Lift (Language.Docker.Syntax.Instruction args)
instance Language.Haskell.TH.Syntax.Lift args => Language.Haskell.TH.Syntax.Lift (Language.Docker.Syntax.Arguments args)
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.BaseImage
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Digest
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Tag
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.ImageAlias
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Image
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Registry
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Ports
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Port
instance Language.Haskell.TH.Syntax.Lift Language.Docker.Syntax.Protocol
instance Language.Haskell.TH.Syntax.Lift Data.Time.Clock.Internal.DiffTime.DiffTime
instance Language.Haskell.TH.Syntax.Lift (Data.Fixed.Fixed a)
instance Language.Haskell.TH.Syntax.Lift a => Language.Haskell.TH.Syntax.Lift (GHC.Base.NonEmpty a)
instance Language.Haskell.TH.Syntax.Lift Data.ByteString.Internal.ByteString
instance Language.Haskell.TH.Syntax.Lift Data.Text.Internal.Text

module Language.Docker.EDSL.Quasi

-- | Quasiquoter for embedding dockerfiles on the EDSL
--   
--   <pre>
--   putStr $ <a>toDockerfile</a> $ do
--       from "node"
--       run "apt-get update"
--       [edockerfile|
--       RUN apt-get update
--       CMD node something.js
--       |]
--   </pre>
edockerfile :: QuasiQuoter
edockerfileE :: String -> ExpQ
dockerfile :: QuasiQuoter
dockerfileE :: String -> ExpQ

module Language.Docker

-- | Type of the Dockerfile AST
type Dockerfile = [InstructionPos Text]
parseText :: Text -> Either Error Dockerfile
parseFile :: FilePath -> IO (Either Error Dockerfile)

-- | Reads the standard input until the end and parses the contents as a
--   Dockerfile
parseStdin :: IO (Either Error Dockerfile)

-- | Pretty-print a <a>ParseError</a>. The rendered <a>String</a> always
--   ends with a newline.
parseErrorPretty :: (Stream s, ShowErrorComponent e) => ParseError s e -> String

-- | Pretty-print a <a>ParseErrorBundle</a>. All <a>ParseError</a>s in the
--   bundle will be pretty-printed in order together with the corresponding
--   offending lines by doing a single efficient pass over the input
--   stream. The rendered <a>String</a> always ends with a newline.
errorBundlePretty :: (Stream s, ShowErrorComponent e) => ParseErrorBundle s e -> String

-- | Pretty print a <a>Dockerfile</a> to a <a>Text</a>
prettyPrint :: Dockerfile -> Text
prettyPrintDockerfile :: Pretty (Arguments args) => [InstructionPos args] -> Doc ann

-- | runs the Dockerfile EDSL and returns a <a>Lazy</a> using
--   <a>PrettyPrint</a>
--   
--   <pre>
--   import Language.Docker
--   
--   main :: IO ()
--   main = print $ toDockerfileText $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "<i>app</i>language-docker"
--       workdir "<i>app</i>language-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   </pre>
toDockerfileText :: EDockerfileM a -> Text

-- | Runs the Dockerfile EDSL and returns a <tt>Dockerfile</tt> you can
--   pretty print or manipulate
toDockerfile :: EDockerfileM a -> Dockerfile

-- | Prints the dockerfile to stdout. Mainly used for debugging purposes
--   
--   <pre>
--   import Language.Docker
--   
--   main :: IO ()
--   main = putDockerfileStr $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "<i>app</i>language-docker"
--       workdir "<i>app</i>language-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   </pre>
putDockerfileStr :: EDockerfileM a -> IO ()

-- | Writes the dockerfile to the given file path after pretty-printing it
--   
--   <pre>
--   import Language.Docker
--   
--   main :: IO ()
--   main = writeDockerFile "build.Dockerfile" $ toDockerfile $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "<i>app</i>language-docker"
--       workdir "<i>app</i>language-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   </pre>
writeDockerFile :: Text -> Dockerfile -> IO ()

-- | A version of <a>toDockerfileText</a> which allows IO actions
toDockerfileTextIO :: MonadIO m => EDockerfileTM m t -> m Text

-- | A version of <a>toDockerfile</a> which allows IO actions
toDockerfileIO :: MonadIO m => EDockerfileTM m t -> m Dockerfile

-- | Just runs the EDSL's writer monad
runDockerfileIO :: MonadIO m => EDockerfileTM m t -> m (t, Dockerfile)

-- | Runs the EDSL's writer monad and pretty-prints the result
runDockerfileTextIO :: MonadIO m => EDockerfileTM m t -> m (t, Text)

-- | Lift a computation from the <a>IO</a> monad.
liftIO :: MonadIO m => IO a -> m a
from :: forall m_aTnx. MonadFree EInstruction m_aTnx => EBaseImage -> m_aTnx ()

-- | Use a specific tag for a docker image. This function is meant to be
--   used as an infix operator.
--   
--   <pre>
--   from $ "fpco/stack-build" <a>tagged</a> "lts-10.3"
--   </pre>
tagged :: Image -> Tag -> EBaseImage

-- | Use a docker image in a FROM instruction without a tag
--   
--   The following two examples are equivalent
--   
--   <pre>
--   from $ untagged "fpco/stack-build"
--   </pre>
--   
--   Is equivalent to, when having OverloadedStrings:
--   
--   <pre>
--   from "fpco/stack-build"
--   </pre>
untagged :: Text -> EBaseImage

-- | Adds a digest checksum so a FROM instruction This function is meant to
--   be used as an infix operator.
--   
--   <pre>
--   from $ "fpco/stack-build" <a>digested</a> "sha256:abcdef123"
--   </pre>
digested :: EBaseImage -> Digest -> EBaseImage

-- | Alias a FROM instruction to be used as a build stage. This function is
--   meant to be used as an infix operator.
--   
--   <pre>
--   from $ "fpco/stack-build" <a>aliased</a> "builder"
--   </pre>
aliased :: EBaseImage -> ImageAlias -> EBaseImage

-- | Create an ADD instruction. This is often used as a shorthand version
--   of copy when no extra options are needed. Currently there is no way to
--   pass extra options to ADD, so you are encouraged to use <a>copy</a>
--   instead.
--   
--   <pre>
--   add ["foo.js", "bar.js"] "."
--   </pre>
add :: MonadFree EInstruction m => NonEmpty SourcePath -> TargetPath -> m ()
user :: forall m_aTpl. MonadFree EInstruction m_aTpl => Text -> m_aTpl ()
label :: forall m_aTpo. MonadFree EInstruction m_aTpo => Pairs -> m_aTpo ()
stopSignal :: forall m_aTpr. MonadFree EInstruction m_aTpr => Text -> m_aTpr ()

-- | Create a COPY instruction. This function is meant to be used with the
--   compinators <a>to</a>, <a>fromStage</a> and <a>ownedBy</a>
--   
--   <pre>
--   copy $ ["foo.js", "bar.js"] <a>to</a> "."
--   copy $ ["some_file"] <a>to</a> "<i>some</i>path" <a>fromStage</a> "builder"
--   </pre>
copy :: MonadFree EInstruction m => CopyArgs -> m ()

-- | Create a COPY instruction from a given build stage. This is a
--   shorthand version of using <a>copy</a> with combinators.
--   
--   <pre>
--   copyFromStage "builder" ["foo.js", "bar.js"] "."
--   </pre>
copyFromStage :: MonadFree EInstruction m => CopySource -> NonEmpty SourcePath -> TargetPath -> m ()

-- | Usedto join source paths with atarget path as an arguments for
--   <a>copy</a>
--   
--   This function is meant to be used as an infix operator:
--   
--   <pre>
--   copy $ ["foo.js"] <a>to</a> "." <a>ownedBy</a>
--   </pre>
to :: NonEmpty SourcePath -> TargetPath -> CopyArgs

-- | Adds the --from= option to a COPY instruction.
--   
--   This function is meant to be used as an infix operator:
--   
--   <pre>
--   copy $ ["foo.js"] <a>to</a> "." <a>fromStage</a> "builder"
--   </pre>
fromStage :: CopyArgs -> CopySource -> CopyArgs

-- | Adds the --chown= option to a COPY instruction.
--   
--   This function is meant to be used as an infix operator:
--   
--   <pre>
--   copy $ ["foo.js"] <a>to</a> "." <a>ownedBy</a> "www-data:www-data"
--   </pre>
ownedBy :: CopyArgs -> Chown -> CopyArgs

-- | Converts a NonEmpty list of strings to a NonEmpty list of
--   <a>SourcePath</a>
--   
--   This is a convenience function when you need to pass a non-static list
--   of strings that you build somewhere as an argument for <a>copy</a> or
--   <a>add</a>
--   
--   <pre>
--   someFiles &lt;- glob "*.js"
--   copy $ (toSources someFiles) <a>to</a> "."
--   </pre>
toSources :: NonEmpty Text -> NonEmpty SourcePath

-- | Converts a Text into a <a>TargetPath</a>
--   
--   This is a convenience function when you need to pass a string variable
--   as an argument for <a>copy</a> or <a>add</a>
--   
--   <pre>
--   let destination = buildSomePath pwd
--   add ["foo.js"] (toTarget destination)
--   </pre>
toTarget :: Text -> TargetPath

-- | Create a RUN instruction with the given arguments.
--   
--   <pre>
--   run "apt-get install wget"
--   </pre>
run :: MonadFree EInstruction m => Arguments Text -> m ()
runArgs :: forall m_aTpA. MonadFree EInstruction m_aTpA => Arguments Text -> m_aTpA ()

-- | Create a CMD instruction with the given arguments.
--   
--   <pre>
--   cmd "my-program --some-flag"
--   </pre>
cmd :: MonadFree EInstruction m => Arguments Text -> m ()
cmdArgs :: forall m_aTpD. MonadFree EInstruction m_aTpD => Arguments Text -> m_aTpD ()
healthcheck :: forall m_aTq8. MonadFree EInstruction m_aTq8 => Check Text -> m_aTq8 ()
check :: Arguments args -> Check args
interval :: Check args -> Integer -> Check args
timeout :: Check args -> Integer -> Check args
startPeriod :: Check args -> Integer -> Check args
retries :: Check args -> Integer -> Check args
workdir :: forall m_aTpJ. MonadFree EInstruction m_aTpJ => Directory -> m_aTpJ ()
expose :: forall m_aTpM. MonadFree EInstruction m_aTpM => Ports -> m_aTpM ()
ports :: [Port] -> Ports
tcpPort :: Int -> Port
udpPort :: Int -> Port
variablePort :: Text -> Port
portRange :: Int -> Int -> Port
udpPortRange :: Int -> Int -> Port
volume :: forall m_aTpP. MonadFree EInstruction m_aTpP => Text -> m_aTpP ()

-- | Create an ENTRYPOINT instruction with the given arguments.
--   
--   <pre>
--   entrypoint "<i>usr</i>local<i>bin</i>program --some-flag"
--   </pre>
entrypoint :: MonadFree EInstruction m => Arguments Text -> m ()
entrypointArgs :: forall m_aTpS. MonadFree EInstruction m_aTpS => Arguments Text -> m_aTpS ()
maintainer :: forall m_aTpV. MonadFree EInstruction m_aTpV => Text -> m_aTpV ()
env :: forall m_aTpY. MonadFree EInstruction m_aTpY => Pairs -> m_aTpY ()
arg :: forall m_aTq1. MonadFree EInstruction m_aTq1 => Text -> Maybe Text -> m_aTq1 ()
comment :: forall m_aTq5. MonadFree EInstruction m_aTq5 => Text -> m_aTq5 ()

-- | ONBUILD Dockerfile instruction
--   
--   Each nested instruction gets emitted as a separate <tt>ONBUILD</tt>
--   block
--   
--   <pre>
--   <a>toDockerfile</a> $ do
--       from "node"
--       run "apt-get update"
--       onBuild $ do
--           run "echo more-stuff"
--           run "echo here"
--   </pre>
onBuild :: MonadFree EInstruction m => EDockerfileM a -> m ()
onBuildRaw :: forall m_aTqb. MonadFree EInstruction m_aTqb => Instruction Text -> m_aTqb ()
embed :: forall m_aTqe. MonadFree EInstruction m_aTqe => [InstructionPos Text] -> m_aTqe ()

-- | Quasiquoter for embedding dockerfiles on the EDSL
--   
--   <pre>
--   putStr $ <a>toDockerfile</a> $ do
--       from "node"
--       run "apt-get update"
--       [edockerfile|
--       RUN apt-get update
--       CMD node something.js
--       |]
--   </pre>
edockerfile :: QuasiQuoter

-- | The type of <tt>Identity</tt> based EDSL blocks
type EDockerfileM = Free EInstruction

-- | The type of free monad EDSL blocks
type EDockerfileTM = FreeT EInstruction
data EBaseImage
EBaseImage :: Image -> Maybe Tag -> Maybe Digest -> Maybe ImageAlias -> Maybe Platform -> EBaseImage
dockerfile :: QuasiQuoter

-- | All commands available in Dockerfiles
data Instruction args
From :: !BaseImage -> Instruction args
Add :: !AddArgs -> Instruction args
User :: !Text -> Instruction args
Label :: !Pairs -> Instruction args
Stopsignal :: !Text -> Instruction args
Copy :: !CopyArgs -> Instruction args
Run :: !Arguments args -> Instruction args
Cmd :: !Arguments args -> Instruction args
Shell :: !Arguments args -> Instruction args
Workdir :: !Directory -> Instruction args
Expose :: !Ports -> Instruction args
Volume :: !Text -> Instruction args
Entrypoint :: !Arguments args -> Instruction args
Maintainer :: !Text -> Instruction args
Env :: !Pairs -> Instruction args
Arg :: !Text -> !Maybe Text -> Instruction args
Healthcheck :: !Check args -> Instruction args
Comment :: !Text -> Instruction args
OnBuild :: !Instruction args -> Instruction args

-- | <a>Instruction</a> with additional location information required for
--   creating good check messages
data InstructionPos args
InstructionPos :: !Instruction args -> !Filename -> !Linenumber -> InstructionPos args
[$sel:instruction:InstructionPos] :: InstructionPos args -> !Instruction args
[$sel:sourcename:InstructionPos] :: InstructionPos args -> !Filename
[$sel:lineNumber:InstructionPos] :: InstructionPos args -> !Linenumber
data BaseImage
BaseImage :: !Image -> !Maybe Tag -> !Maybe Digest -> !Maybe ImageAlias -> !Maybe Platform -> BaseImage
[$sel:image:BaseImage] :: BaseImage -> !Image
[$sel:tag:BaseImage] :: BaseImage -> !Maybe Tag
[$sel:digest:BaseImage] :: BaseImage -> !Maybe Digest
[$sel:alias:BaseImage] :: BaseImage -> !Maybe ImageAlias
[$sel:platform:BaseImage] :: BaseImage -> !Maybe Platform
newtype SourcePath
SourcePath :: Text -> SourcePath
[$sel:unSourcePath:SourcePath] :: SourcePath -> Text
newtype TargetPath
TargetPath :: Text -> TargetPath
[$sel:unTargetPath:TargetPath] :: TargetPath -> Text
data Chown
Chown :: !Text -> Chown
NoChown :: Chown
data CopySource
CopySource :: !Text -> CopySource
NoSource :: CopySource
data CopyArgs
CopyArgs :: NonEmpty SourcePath -> !TargetPath -> !Chown -> !CopySource -> CopyArgs
[$sel:sourcePaths:CopyArgs] :: CopyArgs -> NonEmpty SourcePath
[$sel:targetPath:CopyArgs] :: CopyArgs -> !TargetPath
[$sel:chownFlag:CopyArgs] :: CopyArgs -> !Chown
[$sel:sourceFlag:CopyArgs] :: CopyArgs -> !CopySource
data AddArgs
AddArgs :: NonEmpty SourcePath -> !TargetPath -> !Chown -> AddArgs
[$sel:sourcePaths:AddArgs] :: AddArgs -> NonEmpty SourcePath
[$sel:targetPath:AddArgs] :: AddArgs -> !TargetPath
[$sel:chownFlag:AddArgs] :: AddArgs -> !Chown
data Check args
Check :: !CheckArgs args -> Check args
NoCheck :: Check args
data CheckArgs args
CheckArgs :: !Arguments args -> !Maybe Duration -> !Maybe Duration -> !Maybe Duration -> !Maybe Retries -> CheckArgs args
[$sel:checkCommand:CheckArgs] :: CheckArgs args -> !Arguments args
[$sel:interval:CheckArgs] :: CheckArgs args -> !Maybe Duration
[$sel:timeout:CheckArgs] :: CheckArgs args -> !Maybe Duration
[$sel:startPeriod:CheckArgs] :: CheckArgs args -> !Maybe Duration
[$sel:retries:CheckArgs] :: CheckArgs args -> !Maybe Retries
data Image
Image :: !Maybe Registry -> !Text -> Image
[$sel:registryName:Image] :: Image -> !Maybe Registry
[$sel:imageName:Image] :: Image -> !Text
newtype Registry
Registry :: Text -> Registry
[$sel:unRegistry:Registry] :: Registry -> Text
newtype ImageAlias
ImageAlias :: Text -> ImageAlias
[$sel:unImageAlias:ImageAlias] :: ImageAlias -> Text
newtype Tag
Tag :: Text -> Tag
[$sel:unTag:Tag] :: Tag -> Text
newtype Digest
Digest :: Text -> Digest
[$sel:unDigest:Digest] :: Digest -> Text
data Ports
type Directory = Text
data Arguments args
type Pairs = [(Text, Text)]
type Filename = Text
type Platform = Text
type Linenumber = Int
instructionPos :: Instruction args -> InstructionPos args
