Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type EDockerfileM = Free EInstruction
- type EDockerfileTM = FreeT EInstruction
- type EInstructionM = Free EInstruction
- type EInstructionTM = FreeT EInstruction
- embed :: forall m. MonadFree EInstruction m => [InstructionPos] -> m ()
- onBuildRaw :: forall m. MonadFree EInstruction m => Instruction -> m ()
- comment :: forall m. MonadFree EInstruction m => String -> m ()
- arg :: forall m. MonadFree EInstruction m => String -> m ()
- env :: forall m. MonadFree EInstruction m => Pairs -> m ()
- maintainer :: forall m. MonadFree EInstruction m => String -> m ()
- entrypointArgs :: forall m. MonadFree EInstruction m => Arguments -> m ()
- volume :: forall m. MonadFree EInstruction m => String -> m ()
- expose :: forall m. MonadFree EInstruction m => Ports -> m ()
- workdir :: forall m. MonadFree EInstruction m => Directory -> m ()
- cmdArgs :: forall m. MonadFree EInstruction m => Arguments -> m ()
- runArgs :: forall m. MonadFree EInstruction m => Arguments -> m ()
- copy :: forall m. MonadFree EInstruction m => Source -> Destination -> m ()
- stopSignal :: forall m. MonadFree EInstruction m => String -> m ()
- label :: forall m. MonadFree EInstruction m => Pairs -> m ()
- user :: forall m. MonadFree EInstruction m => String -> m ()
- add :: forall m. MonadFree EInstruction m => Source -> Destination -> m ()
- from :: forall m. MonadFree EInstruction m => EBaseImage -> m ()
- runDockerWriter :: MonadWriter [Instruction] m => EDockerfileM a -> m a
- runDockerWriterIO :: (Monad m, MonadTrans t, Monad (t m), MonadWriter [Instruction] (t m), MonadIO (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] m => EInstruction (m b) -> m b
- instructionPos :: Instruction -> InstructionPos
- toDockerfile :: EDockerfileM a -> Dockerfile
- toDockerfileStr :: EDockerfileM a -> String
- untagged :: String -> EBaseImage
- tagged :: String -> String -> EBaseImage
- digested :: String -> ByteString -> EBaseImage
- ports :: [Integer] -> Ports
- port :: Integer -> Ports
- run :: MonadFree EInstruction m => String -> m ()
- entrypoint :: MonadFree EInstruction m => String -> m ()
- cmd :: MonadFree EInstruction m => String -> m ()
- onBuild :: MonadFree EInstruction m => EDockerfileM a -> m ()
- toDockerfileIO :: MonadIO m => EDockerfileTM m t -> m Dockerfile
- toDockerfileStrIO :: MonadIO m => EDockerfileTM m t -> m String
- runDockerfileIO :: MonadIO m => EDockerfileTM m t -> m (t, Dockerfile)
- runDockerfileStrIO :: MonadIO m => EDockerfileTM m t -> m (t, String)
Documentation
type EDockerfileM = Free EInstruction Source
The type of Identity
based EDSL blocks
type EDockerfileTM = FreeT EInstruction Source
The type of free monad EDSL blocks
type EInstructionM = Free EInstruction Source
type EInstructionTM = FreeT EInstruction Source
embed :: forall m. MonadFree EInstruction m => [InstructionPos] -> m () Source
onBuildRaw :: forall m. MonadFree EInstruction m => Instruction -> m () Source
comment :: forall m. MonadFree EInstruction m => String -> m () Source
arg :: forall m. MonadFree EInstruction m => String -> m () Source
env :: forall m. MonadFree EInstruction m => Pairs -> m () Source
maintainer :: forall m. MonadFree EInstruction m => String -> m () Source
entrypointArgs :: forall m. MonadFree EInstruction m => Arguments -> m () Source
volume :: forall m. MonadFree EInstruction m => String -> m () Source
expose :: forall m. MonadFree EInstruction m => Ports -> m () Source
workdir :: forall m. MonadFree EInstruction m => Directory -> m () Source
cmdArgs :: forall m. MonadFree EInstruction m => Arguments -> m () Source
runArgs :: forall m. MonadFree EInstruction m => Arguments -> m () Source
copy :: forall m. MonadFree EInstruction m => Source -> Destination -> m () Source
stopSignal :: forall m. MonadFree EInstruction m => String -> m () Source
label :: forall m. MonadFree EInstruction m => Pairs -> m () Source
user :: forall m. MonadFree EInstruction m => String -> m () Source
add :: forall m. MonadFree EInstruction m => Source -> Destination -> m () Source
from :: forall m. MonadFree EInstruction m => EBaseImage -> m () Source
runDockerWriter :: MonadWriter [Instruction] m => EDockerfileM a -> m a Source
runDockerWriterIO :: (Monad m, MonadTrans t, Monad (t m), MonadWriter [Instruction] (t m), MonadIO (t m)) => EDockerfileTM m a -> t m a Source
runDef :: MonadWriter [t] m => (t1 -> t) -> t1 -> m b -> m b Source
runDef2 :: MonadWriter [t] m => (t1 -> t2 -> t) -> t1 -> t2 -> m b -> m b Source
runD :: MonadWriter [Instruction] m => EInstruction (m b) -> m b Source
toDockerfile :: EDockerfileM a -> Dockerfile Source
Runs the Dockerfile EDSL and returns a Dockerfile
you can pretty print
or manipulate
toDockerfileStr :: EDockerfileM a -> String Source
runs the Dockerfile EDSL and returns a String
using
PrettyPrint
import Language.Dockerfile main :: IO () main = writeFile "something.dockerfile" $ toDockerfileStr $ do from (tagged "fpco/stack-build" "lts-6.9") add "." "applanguage-dockerfile" workdir "applanguage-dockerfile" run (words "stack build --test --only-dependencies") cmd (words "stack test")
untagged :: String -> EBaseImage Source
tagged :: String -> String -> EBaseImage Source
digested :: String -> ByteString -> EBaseImage Source
run :: MonadFree EInstruction m => String -> m () Source
entrypoint :: MonadFree EInstruction m => String -> m () Source
cmd :: MonadFree EInstruction m => String -> m () Source
onBuild :: MonadFree EInstruction m => EDockerfileM a -> m () Source
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"
toDockerfileIO :: MonadIO m => EDockerfileTM m t -> m Dockerfile Source
A version of toDockerfile
which allows IO actions
toDockerfileStrIO :: MonadIO m => EDockerfileTM m t -> m String Source
A version of toDockerfileStr
which allows IO actions
runDockerfileIO :: MonadIO m => EDockerfileTM m t -> m (t, Dockerfile) Source
Just runs the EDSL's writer monad
runDockerfileStrIO :: MonadIO m => EDockerfileTM m t -> m (t, String) Source
Runs the EDSL's writer monad and pretty-prints the result