language-docker-13.0.0: Dockerfile parser, pretty-printer and embedded DSL
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Docker

Synopsis

Documentation

type Dockerfile = [InstructionPos Text] Source #

Type of the Dockerfile AST

Parsing Dockerfiles (Language.Docker.Syntax and Language.Docker.Parser)

parseStdin :: IO (Either Error Dockerfile) Source #

Reads the standard input until the end and parses the contents as a Dockerfile

Re-exports from megaparsec

parseErrorPretty #

Arguments

:: (VisualStream s, ShowErrorComponent e) 
=> ParseError s e

Parse error to render

-> String

Result of rendering

Pretty-print a ParseError. The rendered String always ends with a newline.

Since: megaparsec-5.0.0

errorBundlePretty #

Arguments

:: (VisualStream s, TraversableStream s, ShowErrorComponent e) 
=> ParseErrorBundle s e

Parse error bundle to display

-> String

Textual rendition of the bundle

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 pass over the input stream. The rendered String always ends with a newline.

Since: megaparsec-7.0.0

Pretty-printing Dockerfiles (Language.Docker.PrettyPrint)

prettyPrint :: Dockerfile -> Text Source #

Pretty print a Dockerfile to a Text

Types (Language.Docker.Syntax)

data Instruction args Source #

All commands available in Dockerfiles

Instances

Instances details
Functor Instruction Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fmap :: (a -> b) -> Instruction a -> Instruction b #

(<$) :: a -> Instruction b -> Instruction a #

Show args => Show (Instruction args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> Instruction args -> ShowS #

show :: Instruction args -> String #

showList :: [Instruction args] -> ShowS #

Eq args => Eq (Instruction args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Instruction args -> Instruction args -> Bool #

(/=) :: Instruction args -> Instruction args -> Bool #

Ord args => Ord (Instruction args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: Instruction args -> Instruction args -> Ordering #

(<) :: Instruction args -> Instruction args -> Bool #

(<=) :: Instruction args -> Instruction args -> Bool #

(>) :: Instruction args -> Instruction args -> Bool #

(>=) :: Instruction args -> Instruction args -> Bool #

max :: Instruction args -> Instruction args -> Instruction args #

min :: Instruction args -> Instruction args -> Instruction args #

data InstructionPos args Source #

Instruction with additional location information required for creating good check messages

Instances

Instances details
Functor InstructionPos Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fmap :: (a -> b) -> InstructionPos a -> InstructionPos b #

(<$) :: a -> InstructionPos b -> InstructionPos a #

Show args => Show (InstructionPos args) Source # 
Instance details

Defined in Language.Docker.Syntax

Eq args => Eq (InstructionPos args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: InstructionPos args -> InstructionPos args -> Bool #

(/=) :: InstructionPos args -> InstructionPos args -> Bool #

Ord args => Ord (InstructionPos args) Source # 
Instance details

Defined in Language.Docker.Syntax

data BaseImage Source #

Constructors

BaseImage 

Fields

data Chown Source #

Constructors

Chown !Text 
NoChown 

Instances

Instances details
IsString Chown Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fromString :: String -> Chown #

Show Chown Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> Chown -> ShowS #

show :: Chown -> String #

showList :: [Chown] -> ShowS #

Eq Chown Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Chown -> Chown -> Bool #

(/=) :: Chown -> Chown -> Bool #

Ord Chown Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: Chown -> Chown -> Ordering #

(<) :: Chown -> Chown -> Bool #

(<=) :: Chown -> Chown -> Bool #

(>) :: Chown -> Chown -> Bool #

(>=) :: Chown -> Chown -> Bool #

max :: Chown -> Chown -> Chown #

min :: Chown -> Chown -> Chown #

data CopyArgs Source #

Instances

Instances details
Show CopyArgs Source # 
Instance details

Defined in Language.Docker.Syntax

Eq CopyArgs Source # 
Instance details

Defined in Language.Docker.Syntax

Ord CopyArgs Source # 
Instance details

Defined in Language.Docker.Syntax

data AddArgs Source #

Instances

Instances details
Show AddArgs Source # 
Instance details

Defined in Language.Docker.Syntax

Eq AddArgs Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: AddArgs -> AddArgs -> Bool #

(/=) :: AddArgs -> AddArgs -> Bool #

Ord AddArgs Source # 
Instance details

Defined in Language.Docker.Syntax

data Check args Source #

Constructors

Check !(CheckArgs args) 
NoCheck 

Instances

Instances details
Functor Check Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fmap :: (a -> b) -> Check a -> Check b #

(<$) :: a -> Check b -> Check a #

Show args => Show (Check args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> Check args -> ShowS #

show :: Check args -> String #

showList :: [Check args] -> ShowS #

Eq args => Eq (Check args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Check args -> Check args -> Bool #

(/=) :: Check args -> Check args -> Bool #

Ord args => Ord (Check args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: Check args -> Check args -> Ordering #

(<) :: Check args -> Check args -> Bool #

(<=) :: Check args -> Check args -> Bool #

(>) :: Check args -> Check args -> Bool #

(>=) :: Check args -> Check args -> Bool #

max :: Check args -> Check args -> Check args #

min :: Check args -> Check args -> Check args #

data CheckArgs args Source #

Instances

Instances details
Functor CheckArgs Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fmap :: (a -> b) -> CheckArgs a -> CheckArgs b #

(<$) :: a -> CheckArgs b -> CheckArgs a #

Show args => Show (CheckArgs args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> CheckArgs args -> ShowS #

show :: CheckArgs args -> String #

showList :: [CheckArgs args] -> ShowS #

Eq args => Eq (CheckArgs args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: CheckArgs args -> CheckArgs args -> Bool #

(/=) :: CheckArgs args -> CheckArgs args -> Bool #

Ord args => Ord (CheckArgs args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: CheckArgs args -> CheckArgs args -> Ordering #

(<) :: CheckArgs args -> CheckArgs args -> Bool #

(<=) :: CheckArgs args -> CheckArgs args -> Bool #

(>) :: CheckArgs args -> CheckArgs args -> Bool #

(>=) :: CheckArgs args -> CheckArgs args -> Bool #

max :: CheckArgs args -> CheckArgs args -> CheckArgs args #

min :: CheckArgs args -> CheckArgs args -> CheckArgs args #

data Image Source #

Constructors

Image 

Instances

Instances details
IsString Image Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fromString :: String -> Image #

Show Image Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> Image -> ShowS #

show :: Image -> String #

showList :: [Image] -> ShowS #

Eq Image Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Image -> Image -> Bool #

(/=) :: Image -> Image -> Bool #

Ord Image Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: Image -> Image -> Ordering #

(<) :: Image -> Image -> Bool #

(<=) :: Image -> Image -> Bool #

(>) :: Image -> Image -> Bool #

(>=) :: Image -> Image -> Bool #

max :: Image -> Image -> Image #

min :: Image -> Image -> Image #

newtype Registry Source #

Constructors

Registry 

Fields

Instances

Instances details
IsString Registry Source # 
Instance details

Defined in Language.Docker.Syntax

Show Registry Source # 
Instance details

Defined in Language.Docker.Syntax

Eq Registry Source # 
Instance details

Defined in Language.Docker.Syntax

Ord Registry Source # 
Instance details

Defined in Language.Docker.Syntax

newtype Tag Source #

Constructors

Tag 

Fields

Instances

Instances details
IsString Tag Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fromString :: String -> Tag #

Show Tag Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

Eq Tag Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Ord Tag Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: Tag -> Tag -> Ordering #

(<) :: Tag -> Tag -> Bool #

(<=) :: Tag -> Tag -> Bool #

(>) :: Tag -> Tag -> Bool #

(>=) :: Tag -> Tag -> Bool #

max :: Tag -> Tag -> Tag #

min :: Tag -> Tag -> Tag #

newtype Digest Source #

Constructors

Digest 

Fields

Instances

Instances details
IsString Digest Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fromString :: String -> Digest #

Show Digest Source # 
Instance details

Defined in Language.Docker.Syntax

Eq Digest Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Digest -> Digest -> Bool #

(/=) :: Digest -> Digest -> Bool #

Ord Digest Source # 
Instance details

Defined in Language.Docker.Syntax

data Ports Source #

Instances

Instances details
IsList Ports Source # 
Instance details

Defined in Language.Docker.Syntax

Associated Types

type Item Ports #

Show Ports Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> Ports -> ShowS #

show :: Ports -> String #

showList :: [Ports] -> ShowS #

Eq Ports Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Ports -> Ports -> Bool #

(/=) :: Ports -> Ports -> Bool #

Ord Ports Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: Ports -> Ports -> Ordering #

(<) :: Ports -> Ports -> Bool #

(<=) :: Ports -> Ports -> Bool #

(>) :: Ports -> Ports -> Bool #

(>=) :: Ports -> Ports -> Bool #

max :: Ports -> Ports -> Ports #

min :: Ports -> Ports -> Ports #

type Item Ports Source # 
Instance details

Defined in Language.Docker.Syntax

data Arguments args Source #

Instances

Instances details
Functor Arguments Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

fmap :: (a -> b) -> Arguments a -> Arguments b #

(<$) :: a -> Arguments b -> Arguments a #

IsString (Arguments Text) Source # 
Instance details

Defined in Language.Docker.Syntax

IsList (Arguments Text) Source # 
Instance details

Defined in Language.Docker.Syntax

Associated Types

type Item (Arguments Text) #

Show args => Show (Arguments args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

showsPrec :: Int -> Arguments args -> ShowS #

show :: Arguments args -> String #

showList :: [Arguments args] -> ShowS #

Eq args => Eq (Arguments args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

(==) :: Arguments args -> Arguments args -> Bool #

(/=) :: Arguments args -> Arguments args -> Bool #

Ord args => Ord (Arguments args) Source # 
Instance details

Defined in Language.Docker.Syntax

Methods

compare :: Arguments args -> Arguments args -> Ordering #

(<) :: Arguments args -> Arguments args -> Bool #

(<=) :: Arguments args -> Arguments args -> Bool #

(>) :: Arguments args -> Arguments args -> Bool #

(>=) :: Arguments args -> Arguments args -> Bool #

max :: Arguments args -> Arguments args -> Arguments args #

min :: Arguments args -> Arguments args -> Arguments args #

type Item (Arguments Text) Source # 
Instance details

Defined in Language.Docker.Syntax

type Pairs = [(Text, Text)] Source #