| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Language.Docker
Synopsis
- type Dockerfile = [InstructionPos Text]
- parseText :: Text -> Either Error Dockerfile
- parseFile :: FilePath -> IO (Either Error Dockerfile)
- parseStdin :: IO (Either Error Dockerfile)
- parseErrorPretty :: (VisualStream s, ShowErrorComponent e) => ParseError s e -> String
- errorBundlePretty :: (VisualStream s, TraversableStream s, ShowErrorComponent e) => ParseErrorBundle s e -> String
- prettyPrint :: Dockerfile -> Text
- prettyPrintDockerfile :: [InstructionPos Text] -> Doc ann
- data Instruction args
- = From !BaseImage
- | Add !AddArgs !AddFlags
- | User !Text
- | Label !Pairs
- | Stopsignal !Text
- | Copy !CopyArgs !CopyFlags
- | Run !(RunArgs args)
- | Cmd !(Arguments args)
- | Shell !(Arguments args)
- | Workdir !Directory
- | Expose !Ports
- | Volume !Text
- | Entrypoint !(Arguments args)
- | Maintainer !Text
- | Env !Pairs
- | Arg !Text !(Maybe Text)
- | Healthcheck !(Check args)
- | Pragma !PragmaDirective
- | Comment !Text
- | OnBuild !(Instruction args)
- data InstructionPos args = InstructionPos {
- instruction :: !(Instruction args)
- sourcename :: !Filename
- lineNumber :: !Linenumber
- data BaseImage = BaseImage {}
- newtype SourcePath = SourcePath {
- unSourcePath :: Text
- newtype TargetPath = TargetPath {
- unTargetPath :: Text
- data Chown
- data CopySource
- = CopySource !Text
- | NoSource
- data CopyArgs = CopyArgs {
- sourcePaths :: NonEmpty SourcePath
- targetPath :: !TargetPath
- data AddArgs = AddArgs {
- sourcePaths :: NonEmpty SourcePath
- targetPath :: !TargetPath
- data Check args
- data CheckArgs args = CheckArgs {
- checkCommand :: !(Arguments args)
- interval :: !(Maybe Duration)
- timeout :: !(Maybe Duration)
- startPeriod :: !(Maybe Duration)
- startInterval :: !(Maybe Duration)
- retries :: !(Maybe Retries)
- data Image = Image {
- registryName :: !(Maybe Registry)
- imageName :: !Text
- newtype Registry = Registry {
- unRegistry :: Text
- newtype ImageAlias = ImageAlias {
- unImageAlias :: Text
- newtype Tag = Tag {
- unTag :: Text
- newtype Digest = Digest {
- unDigest :: Text
- data Ports
- type Directory = Text
- data Arguments args
- type Pairs = [(Text, Text)]
- type Filename = Text
- type Platform = Text
- type Linenumber = Int
Documentation
type Dockerfile = [InstructionPos Text] Source #
Type of the Dockerfile AST
Parsing Dockerfiles (Language.Docker.Syntax and Language.Docker.Parser)
parseText :: Text -> Either Error Dockerfile Source #
parseFile :: FilePath -> IO (Either Error Dockerfile) Source #
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 :: (VisualStream s, ShowErrorComponent e) => ParseError s e -> String #
errorBundlePretty :: (VisualStream s, TraversableStream s, ShowErrorComponent e) => ParseErrorBundle s e -> String #
Pretty-printing Dockerfiles (Language.Docker.PrettyPrint)
prettyPrint :: Dockerfile -> Text Source #
Pretty print a Dockerfile to a Text
prettyPrintDockerfile :: [InstructionPos Text] -> Doc ann Source #
Types (Language.Docker.Syntax)
data Instruction args Source #
All commands available in Dockerfiles
Constructors
| From !BaseImage | |
| Add !AddArgs !AddFlags | |
| User !Text | |
| Label !Pairs | |
| Stopsignal !Text | |
| Copy !CopyArgs !CopyFlags | |
| Run !(RunArgs args) | |
| Cmd !(Arguments args) | |
| Shell !(Arguments args) | |
| Workdir !Directory | |
| Expose !Ports | |
| Volume !Text | |
| Entrypoint !(Arguments args) | |
| Maintainer !Text | |
| Env !Pairs | |
| Arg !Text !(Maybe Text) | |
| Healthcheck !(Check args) | |
| Pragma !PragmaDirective | |
| Comment !Text | |
| OnBuild !(Instruction args) |
Instances
data InstructionPos args Source #
Instruction with additional location information required for creating
good check messages
Constructors
| InstructionPos | |
Fields
| |
Instances
Constructors
| BaseImage | |
newtype SourcePath Source #
Constructors
| SourcePath | |
Fields
| |
Instances
| IsString SourcePath Source # | |
Defined in Language.Docker.Syntax Methods fromString :: String -> SourcePath | |
| Show SourcePath Source # | |
Defined in Language.Docker.Syntax Methods showsPrec :: Int -> SourcePath -> ShowS show :: SourcePath -> String showList :: [SourcePath] -> ShowS | |
| Eq SourcePath Source # | |
Defined in Language.Docker.Syntax | |
| Ord SourcePath Source # | |
Defined in Language.Docker.Syntax Methods compare :: SourcePath -> SourcePath -> Ordering (<) :: SourcePath -> SourcePath -> Bool (<=) :: SourcePath -> SourcePath -> Bool (>) :: SourcePath -> SourcePath -> Bool (>=) :: SourcePath -> SourcePath -> Bool max :: SourcePath -> SourcePath -> SourcePath min :: SourcePath -> SourcePath -> SourcePath | |
newtype TargetPath Source #
Constructors
| TargetPath | |
Fields
| |
Instances
| IsString TargetPath Source # | |
Defined in Language.Docker.Syntax Methods fromString :: String -> TargetPath | |
| Show TargetPath Source # | |
Defined in Language.Docker.Syntax Methods showsPrec :: Int -> TargetPath -> ShowS show :: TargetPath -> String showList :: [TargetPath] -> ShowS | |
| Eq TargetPath Source # | |
Defined in Language.Docker.Syntax | |
| Ord TargetPath Source # | |
Defined in Language.Docker.Syntax Methods compare :: TargetPath -> TargetPath -> Ordering (<) :: TargetPath -> TargetPath -> Bool (<=) :: TargetPath -> TargetPath -> Bool (>) :: TargetPath -> TargetPath -> Bool (>=) :: TargetPath -> TargetPath -> Bool max :: TargetPath -> TargetPath -> TargetPath min :: TargetPath -> TargetPath -> TargetPath | |
data CopySource Source #
Constructors
| CopySource !Text | |
| NoSource |
Instances
| IsString CopySource Source # | |
Defined in Language.Docker.Syntax Methods fromString :: String -> CopySource | |
| Show CopySource Source # | |
Defined in Language.Docker.Syntax Methods showsPrec :: Int -> CopySource -> ShowS show :: CopySource -> String showList :: [CopySource] -> ShowS | |
| Eq CopySource Source # | |
Defined in Language.Docker.Syntax | |
| Ord CopySource Source # | |
Defined in Language.Docker.Syntax Methods compare :: CopySource -> CopySource -> Ordering (<) :: CopySource -> CopySource -> Bool (<=) :: CopySource -> CopySource -> Bool (>) :: CopySource -> CopySource -> Bool (>=) :: CopySource -> CopySource -> Bool max :: CopySource -> CopySource -> CopySource min :: CopySource -> CopySource -> CopySource | |
Constructors
| CopyArgs | |
Fields
| |
Constructors
| AddArgs | |
Fields
| |
Instances
| Functor Check Source # | |
| Show args => Show (Check args) Source # | |
| Eq args => Eq (Check args) Source # | |
| Ord args => Ord (Check args) Source # | |
Constructors
| CheckArgs | |
Fields
| |
Instances
| Functor CheckArgs Source # | |
| Show args => Show (CheckArgs args) Source # | |
| Eq args => Eq (CheckArgs args) Source # | |
| Ord args => Ord (CheckArgs args) Source # | |
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 | |
Constructors
| Image | |
Fields
| |
Constructors
| Registry | |
Fields
| |
newtype ImageAlias Source #
Constructors
| ImageAlias | |
Fields
| |
Instances
| IsString ImageAlias Source # | |
Defined in Language.Docker.Syntax Methods fromString :: String -> ImageAlias | |
| Show ImageAlias Source # | |
Defined in Language.Docker.Syntax Methods showsPrec :: Int -> ImageAlias -> ShowS show :: ImageAlias -> String showList :: [ImageAlias] -> ShowS | |
| Eq ImageAlias Source # | |
Defined in Language.Docker.Syntax | |
| Ord ImageAlias Source # | |
Defined in Language.Docker.Syntax Methods compare :: ImageAlias -> ImageAlias -> Ordering (<) :: ImageAlias -> ImageAlias -> Bool (<=) :: ImageAlias -> ImageAlias -> Bool (>) :: ImageAlias -> ImageAlias -> Bool (>=) :: ImageAlias -> ImageAlias -> Bool max :: ImageAlias -> ImageAlias -> ImageAlias min :: ImageAlias -> ImageAlias -> ImageAlias | |
Instances
| Functor Arguments Source # | |||||
| IsString (Arguments Text) Source # | |||||
Defined in Language.Docker.Syntax Methods fromString :: String -> Arguments Text | |||||
| IsList (Arguments Text) Source # | |||||
Defined in Language.Docker.Syntax Associated Types
| |||||
| Show args => Show (Arguments args) Source # | |||||
| Eq args => Eq (Arguments args) Source # | |||||
| Ord args => Ord (Arguments args) Source # | |||||
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 | |||||
| type Item (Arguments Text) Source # | |||||
Defined in Language.Docker.Syntax type Item (Arguments Text) = Text | |||||
type Linenumber = Int Source #