-- 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 Language.Docker. For more fine-grained -- operations look for specific modules that implement a certain -- functionality. See the GitHub project for the source-code and -- examples. @package language-docker @version 6.0.3 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 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 newtype ImageAlias ImageAlias :: Text -> ImageAlias [$sel:unImageAlias:ImageAlias] :: ImageAlias -> Text data BaseImage UntaggedImage :: !Image -> !(Maybe ImageAlias) -> BaseImage TaggedImage :: !Image -> !Tag -> !(Maybe ImageAlias) -> BaseImage DigestedImage :: !Image -> !Text -> !(Maybe ImageAlias) -> BaseImage -- | 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 -- | Instruction 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.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 Dockerfile to a Text prettyPrint :: Dockerfile -> Text prettyPrintDockerfile :: Pretty (Arguments args) => [InstructionPos args] -> Doc ann -- | Pretty print a InstructionPos to a Doc 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) type Parser = Parsec DockerfileError Text type Error = ParseError Char 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 EUntaggedImage :: Image -> (Maybe ImageAlias) -> EBaseImage ETaggedImage :: Image -> Tag -> (Maybe ImageAlias) -> EBaseImage EDigestedImage :: Image -> Text -> (Maybe ImageAlias) -> 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 Identity 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_aOB7. MonadFree EInstruction m_aOB7 => [InstructionPos Text] -> m_aOB7 () onBuildRaw :: forall m_aOB4. MonadFree EInstruction m_aOB4 => Instruction Text -> m_aOB4 () healthcheck :: forall m_aOB1. MonadFree EInstruction m_aOB1 => Check Text -> m_aOB1 () comment :: forall m_aOAY. MonadFree EInstruction m_aOAY => Text -> m_aOAY () arg :: forall m_aOAU. MonadFree EInstruction m_aOAU => Text -> Maybe Text -> m_aOAU () env :: forall m_aOAR. MonadFree EInstruction m_aOAR => Pairs -> m_aOAR () maintainer :: forall m_aOAO. MonadFree EInstruction m_aOAO => Text -> m_aOAO () entrypointArgs :: forall m_aOAL. MonadFree EInstruction m_aOAL => Arguments Text -> m_aOAL () volume :: forall m_aOAI. MonadFree EInstruction m_aOAI => Text -> m_aOAI () expose :: forall m_aOAF. MonadFree EInstruction m_aOAF => Ports -> m_aOAF () workdir :: forall m_aOAC. MonadFree EInstruction m_aOAC => Directory -> m_aOAC () shell :: forall m_aOAz. MonadFree EInstruction m_aOAz => Arguments Text -> m_aOAz () cmdArgs :: forall m_aOAw. MonadFree EInstruction m_aOAw => Arguments Text -> m_aOAw () runArgs :: forall m_aOAt. MonadFree EInstruction m_aOAt => Arguments Text -> m_aOAt () copyArgs :: forall m_aOAn. MonadFree EInstruction m_aOAn => NonEmpty SourcePath -> TargetPath -> Chown -> CopySource -> m_aOAn () stopSignal :: forall m_aOAk. MonadFree EInstruction m_aOAk => Text -> m_aOAk () label :: forall m_aOAh. MonadFree EInstruction m_aOAh => Pairs -> m_aOAh () user :: forall m_aOAe. MonadFree EInstruction m_aOAe => Text -> m_aOAe () addArgs :: forall m_aOA9. MonadFree EInstruction m_aOA9 => NonEmpty SourcePath -> TargetPath -> Chown -> m_aOA9 () from :: forall m_aOzu. MonadFree EInstruction m_aOzu => EBaseImage -> m_aOzu () 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 Dockerfile you can -- pretty print or manipulate toDockerfile :: EDockerfileM a -> Dockerfile -- | runs the Dockerfile EDSL and returns a Lazy using -- PrettyPrint -- --
--   import Language.Docker
--   
--   main :: IO ()
--   main = print $ toDockerfileText $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "applanguage-docker"
--       workdir "applanguage-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   
toDockerfileText :: EDockerfileM a -> Text -- | Writes the dockerfile to the given file path after pretty-printing it -- --
--   import Language.Docker
--   
--   main :: IO ()
--   main = writeDockerFile "build.Dockerfile" $ toDockerfile $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "applanguage-docker"
--       workdir "applanguage-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   
writeDockerFile :: Text -> Dockerfile -> IO () -- | Prints the dockerfile to stdout. Mainly used for debugging purposes -- --
--   import Language.Docker
--   
--   main :: IO ()
--   main = putDockerfileStr $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "applanguage-docker"
--       workdir "applanguage-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   
putDockerfileStr :: EDockerfileM a -> IO () -- | Use a docker image in a FROM instruction without a tag -- -- The following two examples are equivalent -- --
--   from $ untagged "fpco/stack-build"
--   
-- -- Is equivalent to, when having OverloadedStrings: -- --
--   from "fpco/stack-build"
--   
untagged :: Text -> EBaseImage -- | Use a specific tag for a docker image. This function is meant to be -- used as an infix operator. -- --
--   from $ "fpco/stack-build" tagged "lts-10.3"
--   
tagged :: Image -> Tag -> EBaseImage digested :: Image -> Text -> EBaseImage -- | Alias a FROM instruction to be used as a build stage. This function is -- meant to be used as an infix operator. -- --
--   from $ "fpco/stack-build" aliased "builder"
--   
aliased :: EBaseImage -> Text -> EBaseImage -- | Create a RUN instruction with the given arguments. -- --
--   run "apt-get install wget"
--   
run :: MonadFree EInstruction m => Arguments Text -> m () -- | Create an ENTRYPOINT instruction with the given arguments. -- --
--   entrypoint "usrlocalbinprogram --some-flag"
--   
entrypoint :: MonadFree EInstruction m => Arguments Text -> m () -- | Create a CMD instruction with the given arguments. -- --
--   cmd "my-program --some-flag"
--   
cmd :: MonadFree EInstruction m => Arguments Text -> m () -- | Create a COPY instruction. This function is meant to be used with the -- compinators to, fromStage and ownedBy -- --
--   copy $ ["foo.js", "bar.js"] to "."
--   copy $ ["some_file"] to "somepath" fromStage "builder"
--   
copy :: MonadFree EInstruction m => CopyArgs -> m () -- | Create a COPY instruction from a given build stage. This is a -- shorthand version of using copy with combinators. -- --
--   copyFromStage "builder" ["foo.js", "bar.js"] "."
--   
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 copy -- instead. -- --
--   add ["foo.js", "bar.js"] "."
--   
add :: MonadFree EInstruction m => NonEmpty SourcePath -> TargetPath -> m () -- | Converts a NonEmpty list of strings to a NonEmpty list of -- SourcePath -- -- This is a convenience function when you need to pass a non-static list -- of strings that you build somewhere as an argument for copy or -- add -- --
--   someFiles <- glob "*.js"
--   copy $ (toSources someFiles) to "."
--   
toSources :: NonEmpty Text -> NonEmpty SourcePath -- | Converts a Text into a TargetPath -- -- This is a convenience function when you need to pass a string variable -- as an argument for copy or add -- --
--   let destination = buildSomePath pwd
--   add ["foo.js"] (toTarget destination)
--   
toTarget :: Text -> TargetPath -- | Adds the --from= option to a COPY instruction. -- -- This function is meant to be used as an infix operator: -- --
--   copy $ ["foo.js"] to "." fromStage "builder"
--   
fromStage :: CopyArgs -> CopySource -> CopyArgs -- | Adds the --chown= option to a COPY instruction. -- -- This function is meant to be used as an infix operator: -- --
--   copy $ ["foo.js"] to "." ownedBy "www-data:www-data"
--   
ownedBy :: CopyArgs -> Chown -> CopyArgs -- | Usedto join source paths with atarget path as an arguments for -- copy -- -- This function is meant to be used as an infix operator: -- --
--   copy $ ["foo.js"] to "." ownedBy
--   
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 ONBUILD -- block -- --
--   toDockerfile $ do
--       from "node"
--       run "apt-get update"
--       onBuild $ do
--           run "echo more-stuff"
--           run "echo here"
--   
onBuild :: MonadFree EInstruction m => EDockerfileM a -> m () -- | A version of toDockerfile which allows IO actions toDockerfileIO :: MonadIO m => EDockerfileTM m t -> m Dockerfile -- | A version of toDockerfileText 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.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 -- --
--   putStr $ toDockerfile $ do
--       from "node"
--       run "apt-get update"
--       [edockerfile|
--       RUN apt-get update
--       CMD node something.js
--       |]
--   
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) -- | Pretty-print a ParseError. The rendered String always -- ends with a newline. parseErrorPretty :: (Ord t, ShowToken t, ShowErrorComponent e) => ParseError t e -> String -- | Pretty print a Dockerfile to a Text prettyPrint :: Dockerfile -> Text prettyPrintDockerfile :: Pretty (Arguments args) => [InstructionPos args] -> Doc ann -- | runs the Dockerfile EDSL and returns a Lazy using -- PrettyPrint -- --
--   import Language.Docker
--   
--   main :: IO ()
--   main = print $ toDockerfileText $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "applanguage-docker"
--       workdir "applanguage-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   
toDockerfileText :: EDockerfileM a -> Text -- | Runs the Dockerfile EDSL and returns a Dockerfile you can -- pretty print or manipulate toDockerfile :: EDockerfileM a -> Dockerfile -- | Prints the dockerfile to stdout. Mainly used for debugging purposes -- --
--   import Language.Docker
--   
--   main :: IO ()
--   main = putDockerfileStr $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "applanguage-docker"
--       workdir "applanguage-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   
putDockerfileStr :: EDockerfileM a -> IO () -- | Writes the dockerfile to the given file path after pretty-printing it -- --
--   import Language.Docker
--   
--   main :: IO ()
--   main = writeDockerFile "build.Dockerfile" $ toDockerfile $ do
--       from (tagged "fpco/stack-build" "lts-6.9")
--       add ["."] "applanguage-docker"
--       workdir "applanguage-docker"
--       run "stack build --test --only-dependencies"
--       cmd "stack test"
--   
writeDockerFile :: Text -> Dockerfile -> IO () -- | A version of toDockerfileText which allows IO actions toDockerfileTextIO :: MonadIO m => EDockerfileTM m t -> m Text -- | A version of toDockerfile 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 IO monad. liftIO :: MonadIO m => IO a -> m a from :: forall m_aOzu. MonadFree EInstruction m_aOzu => EBaseImage -> m_aOzu () -- | Use a specific tag for a docker image. This function is meant to be -- used as an infix operator. -- --
--   from $ "fpco/stack-build" tagged "lts-10.3"
--   
tagged :: Image -> Tag -> EBaseImage -- | Use a docker image in a FROM instruction without a tag -- -- The following two examples are equivalent -- --
--   from $ untagged "fpco/stack-build"
--   
-- -- Is equivalent to, when having OverloadedStrings: -- --
--   from "fpco/stack-build"
--   
untagged :: Text -> EBaseImage digested :: Image -> Text -> EBaseImage -- | Alias a FROM instruction to be used as a build stage. This function is -- meant to be used as an infix operator. -- --
--   from $ "fpco/stack-build" aliased "builder"
--   
aliased :: EBaseImage -> Text -> 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 copy -- instead. -- --
--   add ["foo.js", "bar.js"] "."
--   
add :: MonadFree EInstruction m => NonEmpty SourcePath -> TargetPath -> m () user :: forall m_aOAe. MonadFree EInstruction m_aOAe => Text -> m_aOAe () label :: forall m_aOAh. MonadFree EInstruction m_aOAh => Pairs -> m_aOAh () stopSignal :: forall m_aOAk. MonadFree EInstruction m_aOAk => Text -> m_aOAk () -- | Create a COPY instruction. This function is meant to be used with the -- compinators to, fromStage and ownedBy -- --
--   copy $ ["foo.js", "bar.js"] to "."
--   copy $ ["some_file"] to "somepath" fromStage "builder"
--   
copy :: MonadFree EInstruction m => CopyArgs -> m () -- | Create a COPY instruction from a given build stage. This is a -- shorthand version of using copy with combinators. -- --
--   copyFromStage "builder" ["foo.js", "bar.js"] "."
--   
copyFromStage :: MonadFree EInstruction m => CopySource -> NonEmpty SourcePath -> TargetPath -> m () -- | Usedto join source paths with atarget path as an arguments for -- copy -- -- This function is meant to be used as an infix operator: -- --
--   copy $ ["foo.js"] to "." ownedBy
--   
to :: NonEmpty SourcePath -> TargetPath -> CopyArgs -- | Adds the --from= option to a COPY instruction. -- -- This function is meant to be used as an infix operator: -- --
--   copy $ ["foo.js"] to "." fromStage "builder"
--   
fromStage :: CopyArgs -> CopySource -> CopyArgs -- | Adds the --chown= option to a COPY instruction. -- -- This function is meant to be used as an infix operator: -- --
--   copy $ ["foo.js"] to "." ownedBy "www-data:www-data"
--   
ownedBy :: CopyArgs -> Chown -> CopyArgs -- | Converts a NonEmpty list of strings to a NonEmpty list of -- SourcePath -- -- This is a convenience function when you need to pass a non-static list -- of strings that you build somewhere as an argument for copy or -- add -- --
--   someFiles <- glob "*.js"
--   copy $ (toSources someFiles) to "."
--   
toSources :: NonEmpty Text -> NonEmpty SourcePath -- | Converts a Text into a TargetPath -- -- This is a convenience function when you need to pass a string variable -- as an argument for copy or add -- --
--   let destination = buildSomePath pwd
--   add ["foo.js"] (toTarget destination)
--   
toTarget :: Text -> TargetPath -- | Create a RUN instruction with the given arguments. -- --
--   run "apt-get install wget"
--   
run :: MonadFree EInstruction m => Arguments Text -> m () runArgs :: forall m_aOAt. MonadFree EInstruction m_aOAt => Arguments Text -> m_aOAt () -- | Create a CMD instruction with the given arguments. -- --
--   cmd "my-program --some-flag"
--   
cmd :: MonadFree EInstruction m => Arguments Text -> m () cmdArgs :: forall m_aOAw. MonadFree EInstruction m_aOAw => Arguments Text -> m_aOAw () healthcheck :: forall m_aOB1. MonadFree EInstruction m_aOB1 => Check Text -> m_aOB1 () 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_aOAC. MonadFree EInstruction m_aOAC => Directory -> m_aOAC () expose :: forall m_aOAF. MonadFree EInstruction m_aOAF => Ports -> m_aOAF () ports :: [Port] -> Ports tcpPort :: Int -> Port udpPort :: Int -> Port variablePort :: Text -> Port portRange :: Int -> Int -> Port udpPortRange :: Int -> Int -> Port volume :: forall m_aOAI. MonadFree EInstruction m_aOAI => Text -> m_aOAI () -- | Create an ENTRYPOINT instruction with the given arguments. -- --
--   entrypoint "usrlocalbinprogram --some-flag"
--   
entrypoint :: MonadFree EInstruction m => Arguments Text -> m () entrypointArgs :: forall m_aOAL. MonadFree EInstruction m_aOAL => Arguments Text -> m_aOAL () maintainer :: forall m_aOAO. MonadFree EInstruction m_aOAO => Text -> m_aOAO () env :: forall m_aOAR. MonadFree EInstruction m_aOAR => Pairs -> m_aOAR () arg :: forall m_aOAU. MonadFree EInstruction m_aOAU => Text -> Maybe Text -> m_aOAU () comment :: forall m_aOAY. MonadFree EInstruction m_aOAY => Text -> m_aOAY () -- | ONBUILD Dockerfile instruction -- -- Each nested instruction gets emitted as a separate ONBUILD -- block -- --
--   toDockerfile $ do
--       from "node"
--       run "apt-get update"
--       onBuild $ do
--           run "echo more-stuff"
--           run "echo here"
--   
onBuild :: MonadFree EInstruction m => EDockerfileM a -> m () onBuildRaw :: forall m_aOB4. MonadFree EInstruction m_aOB4 => Instruction Text -> m_aOB4 () embed :: forall m_aOB7. MonadFree EInstruction m_aOB7 => [InstructionPos Text] -> m_aOB7 () -- | Quasiquoter for embedding dockerfiles on the EDSL -- --
--   putStr $ toDockerfile $ do
--       from "node"
--       run "apt-get update"
--       [edockerfile|
--       RUN apt-get update
--       CMD node something.js
--       |]
--   
edockerfile :: QuasiQuoter -- | The type of Identity based EDSL blocks type EDockerfileM = Free EInstruction -- | The type of free monad EDSL blocks type EDockerfileTM = FreeT EInstruction data EBaseImage EUntaggedImage :: Image -> (Maybe ImageAlias) -> EBaseImage ETaggedImage :: Image -> Tag -> (Maybe ImageAlias) -> EBaseImage EDigestedImage :: Image -> Text -> (Maybe ImageAlias) -> 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 -- | Instruction 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 UntaggedImage :: !Image -> !(Maybe ImageAlias) -> BaseImage TaggedImage :: !Image -> !Tag -> !(Maybe ImageAlias) -> BaseImage DigestedImage :: !Image -> !Text -> !(Maybe ImageAlias) -> BaseImage 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 data Ports type Directory = Text data Arguments args type Pairs = [(Text, Text)] type Filename = Text type Linenumber = Int instructionPos :: Instruction args -> InstructionPos args