dockerfile-0.2.0: A Haskell DSL for generating Dockerfiles

Safe HaskellSafe
LanguageHaskell2010

Data.Docker

Contents

Description

A Simple DSL for describing and generating Dockerfiles in Haskell

Compatible w/ Docker v18.03

main :: IO ()
main = putStrLn $
  dockerfile $ do
      from "debian:stable"
      maintainer "creichert creichert07@gmail.com"
      run "apt-get -y update"
      run "apt-get -y upgrade"
      cmd [ "echo", "hello world"]
Synopsis

Types

type Docker a = Writer DockerFile a #

A Docker writer monad for creating Dockerfiles

data CopyOpt #

Instances
Show CopyOpt # 
Instance details

Defined in Data.Docker

dockerfile :: Docker a -> String #

Render a list of Docker instructions to a String.

dockerfileWrite :: FilePath -> Docker a -> IO () #

Render a list of Docker instructions to a FilePath.

Docker Instructions

from :: String -> Docker () #

fromas :: String -> As -> Docker () #

run :: Script -> Docker () #

cmd :: [ScriptFile] -> Docker () #

label :: [(String, String)] -> Docker () #

expose :: Int -> Docker () #

env :: String -> String -> Docker () #

add :: [FilePath] -> FilePath -> Docker () #

copy :: [FilePath] -> FilePath -> Docker () #

entrypoint :: FilePath -> [Param] -> Docker () #

volume :: [FilePath] -> Docker () #

user :: String -> Docker () #

onbuild :: Instruction -> Docker () #

shell :: String -> Docker () #