-- 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 8.0.1 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 -- | 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.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 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) -- | 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 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_aQ3y. MonadFree EInstruction m_aQ3y => [InstructionPos Text] -> m_aQ3y () onBuildRaw :: forall m_aQ3v. MonadFree EInstruction m_aQ3v => Instruction Text -> m_aQ3v () healthcheck :: forall m_aQ3s. MonadFree EInstruction m_aQ3s => Check Text -> m_aQ3s () comment :: forall m_aQ3p. MonadFree EInstruction m_aQ3p => Text -> m_aQ3p () arg :: forall m_aQ3l. MonadFree EInstruction m_aQ3l => Text -> Maybe Text -> m_aQ3l () env :: forall m_aQ3i. MonadFree EInstruction m_aQ3i => Pairs -> m_aQ3i () maintainer :: forall m_aQ3f. MonadFree EInstruction m_aQ3f => Text -> m_aQ3f () entrypointArgs :: forall m_aQ3c. MonadFree EInstruction m_aQ3c => Arguments Text -> m_aQ3c () volume :: forall m_aQ39. MonadFree EInstruction m_aQ39 => Text -> m_aQ39 () expose :: forall m_aQ36. MonadFree EInstruction m_aQ36 => Ports -> m_aQ36 () workdir :: forall m_aQ33. MonadFree EInstruction m_aQ33 => Directory -> m_aQ33 () shell :: forall m_aQ30. MonadFree EInstruction m_aQ30 => Arguments Text -> m_aQ30 () cmdArgs :: forall m_aQ2X. MonadFree EInstruction m_aQ2X => Arguments Text -> m_aQ2X () runArgs :: forall m_aQ2U. MonadFree EInstruction m_aQ2U => Arguments Text -> m_aQ2U () copyArgs :: forall m_aQ2O. MonadFree EInstruction m_aQ2O => NonEmpty SourcePath -> TargetPath -> Chown -> CopySource -> m_aQ2O () stopSignal :: forall m_aQ2L. MonadFree EInstruction m_aQ2L => Text -> m_aQ2L () label :: forall m_aQ2I. MonadFree EInstruction m_aQ2I => Pairs -> m_aQ2I () user :: forall m_aQ2F. MonadFree EInstruction m_aQ2F => Text -> m_aQ2F () addArgs :: forall m_aQ2A. MonadFree EInstruction m_aQ2A => NonEmpty SourcePath -> TargetPath -> Chown -> m_aQ2A () from :: forall m_aQ1V. MonadFree EInstruction m_aQ1V => EBaseImage -> m_aQ1V () 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 -- | Adds a digest checksum so a FROM instruction This function is meant to -- be used as an infix operator. -- --
--   from $ "fpco/stack-build" digested "sha256:abcdef123"
--   
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. -- --
--   from $ "fpco/stack-build" aliased "builder"
--   
aliased :: EBaseImage -> ImageAlias -> 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.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 -- --
--   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) -- | Reads the standard input until the end and parses the contents as a -- Dockerfile parseStdin :: IO (Either Error Dockerfile) -- | Pretty-print a ParseError. The rendered String always -- ends with a newline. parseErrorPretty :: (Stream s, ShowErrorComponent e) => ParseError s e -> String -- | Pretty-print a ParseErrorBundle. All ParseErrors 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 String always ends with a newline. errorBundlePretty :: (Stream s, ShowErrorComponent e) => ParseErrorBundle s 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_aQ1V. MonadFree EInstruction m_aQ1V => EBaseImage -> m_aQ1V () -- | 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 -- | Adds a digest checksum so a FROM instruction This function is meant to -- be used as an infix operator. -- --
--   from $ "fpco/stack-build" digested "sha256:abcdef123"
--   
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. -- --
--   from $ "fpco/stack-build" aliased "builder"
--   
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 copy -- instead. -- --
--   add ["foo.js", "bar.js"] "."
--   
add :: MonadFree EInstruction m => NonEmpty SourcePath -> TargetPath -> m () user :: forall m_aQ2F. MonadFree EInstruction m_aQ2F => Text -> m_aQ2F () label :: forall m_aQ2I. MonadFree EInstruction m_aQ2I => Pairs -> m_aQ2I () stopSignal :: forall m_aQ2L. MonadFree EInstruction m_aQ2L => Text -> m_aQ2L () -- | 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_aQ2U. MonadFree EInstruction m_aQ2U => Arguments Text -> m_aQ2U () -- | Create a CMD instruction with the given arguments. -- --
--   cmd "my-program --some-flag"
--   
cmd :: MonadFree EInstruction m => Arguments Text -> m () cmdArgs :: forall m_aQ2X. MonadFree EInstruction m_aQ2X => Arguments Text -> m_aQ2X () healthcheck :: forall m_aQ3s. MonadFree EInstruction m_aQ3s => Check Text -> m_aQ3s () 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_aQ33. MonadFree EInstruction m_aQ33 => Directory -> m_aQ33 () expose :: forall m_aQ36. MonadFree EInstruction m_aQ36 => Ports -> m_aQ36 () ports :: [Port] -> Ports tcpPort :: Int -> Port udpPort :: Int -> Port variablePort :: Text -> Port portRange :: Int -> Int -> Port udpPortRange :: Int -> Int -> Port volume :: forall m_aQ39. MonadFree EInstruction m_aQ39 => Text -> m_aQ39 () -- | Create an ENTRYPOINT instruction with the given arguments. -- --
--   entrypoint "usrlocalbinprogram --some-flag"
--   
entrypoint :: MonadFree EInstruction m => Arguments Text -> m () entrypointArgs :: forall m_aQ3c. MonadFree EInstruction m_aQ3c => Arguments Text -> m_aQ3c () maintainer :: forall m_aQ3f. MonadFree EInstruction m_aQ3f => Text -> m_aQ3f () env :: forall m_aQ3i. MonadFree EInstruction m_aQ3i => Pairs -> m_aQ3i () arg :: forall m_aQ3l. MonadFree EInstruction m_aQ3l => Text -> Maybe Text -> m_aQ3l () comment :: forall m_aQ3p. MonadFree EInstruction m_aQ3p => Text -> m_aQ3p () -- | 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_aQ3v. MonadFree EInstruction m_aQ3v => Instruction Text -> m_aQ3v () embed :: forall m_aQ3y. MonadFree EInstruction m_aQ3y => [InstructionPos Text] -> m_aQ3y () -- | 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 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 -- | 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 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