Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Endpoint
- = VersionEndpoint
- | ListContainersEndpoint ListOpts
- | ListImagesEndpoint ListOpts
- | CreateContainerEndpoint CreateOpts (Maybe ContainerName)
- | StartContainerEndpoint StartOpts ContainerID
- | StopContainerEndpoint Timeout ContainerID
- | WaitContainerEndpoint ContainerID
- | KillContainerEndpoint Signal ContainerID
- | RestartContainerEndpoint Timeout ContainerID
- | PauseContainerEndpoint ContainerID
- | UnpauseContainerEndpoint ContainerID
- | ContainerLogsEndpoint LogOpts Bool ContainerID
- | DeleteContainerEndpoint DeleteOpts ContainerID
- | InspectContainerEndpoint ContainerID
- | BuildImageEndpoint BuildOpts FilePath
- | CreateImageEndpoint Text Tag (Maybe Text)
- type URL = Text
- type ApiVersion = Text
- data ContainerID
- fromContainerID :: ContainerID -> Text
- toContainerID :: Text -> Maybe ContainerID
- data ImageID
- fromImageID :: ImageID -> Text
- toImageID :: Text -> Maybe ImageID
- data Timeout
- data StatusCode = StatusCode Int
- data Signal
- data ContainerDetails = ContainerDetails {
- appArmorProfile :: Text
- args :: [Text]
- containerDetailsConfig :: ContainerConfig
- created :: UTCTime
- driver :: Text
- containerDetailsHostConfig :: HostConfig
- hostnamePath :: FilePath
- hostsPath :: FilePath
- logPath :: FilePath
- containerDetailsId :: ContainerID
- containerDetailsImage :: ImageID
- mountLabel :: Text
- name :: Text
- networkSettings :: NetworkSettings
- path :: FilePath
- processLabel :: Text
- resolveConfPath :: FilePath
- restartCount :: Int
- state :: ContainerState
- mounts :: [Mount]
- data DockerClientOpts = DockerClientOpts {
- apiVer :: ApiVersion
- baseUrl :: URL
- defaultClientOpts :: DockerClientOpts
- data ListOpts = ListOpts {}
- defaultListOpts :: ListOpts
- data DockerVersion = DockerVersion {
- version :: Text
- apiVersion :: ApiVersion
- gitCommit :: Text
- goVersion :: Text
- os :: Text
- arch :: Text
- kernelVersion :: Text
- buildTime :: Text
- data ContainerPortInfo = ContainerPortInfo {
- ipAddressInfo :: Maybe Text
- privatePortInfo :: Port
- publicPortInfo :: Maybe Port
- portTypeInfo :: Maybe PortType
- data Container = Container {
- containerId :: ContainerID
- containerNames :: [Text]
- containerImageName :: Text
- containerImageId :: ImageID
- containerCommand :: Text
- containerCreatedAt :: Int
- containerStatus :: Status
- containerPorts :: [ContainerPortInfo]
- containerLabels :: [Label]
- containerNetworks :: [Network]
- containerMounts :: [Mount]
- data ContainerState = ContainerState {}
- data Status
- type Digest = Text
- data Label = Label Name Value
- type Tag = Text
- data Image = DockerImage {
- imageId :: ImageID
- imageCreated :: Integer
- imageParentId :: Maybe ImageID
- imageRepoTags :: [Tag]
- imageRepoDigests :: [Digest]
- imageSize :: Integer
- imageVirtualSize :: Integer
- imageLabels :: [Label]
- dropImagePrefix :: [a] -> [a]
- data CreateOpts = CreateOpts {}
- data BuildOpts = BuildOpts {
- buildImageName :: Text
- buildDockerfileName :: Text
- buildQuiet :: Bool
- buildNoCache :: Bool
- buildRemoveItermediate :: Bool
- buildForceRemoveIntermediate :: Bool
- buildPullParent :: Bool
- defaultBuildOpts :: Text -> BuildOpts
- defaultCreateOpts :: Text -> CreateOpts
- data DetachKeys
- data StartOpts = StartOpts {}
- defaultStartOpts :: StartOpts
- data DeleteOpts = DeleteOpts {
- deleteVolumes :: Bool
- force :: Bool
- defaultDeleteOpts :: DeleteOpts
- type Timestamp = Integer
- data TailLogOpt
- data LogOpts = LogOpts {}
- defaultLogOpts :: LogOpts
- data VolumePermission
- data Bind = Bind {
- hostSrc :: Text
- containerDest :: Text
- volumePermission :: Maybe VolumePermission
- newtype Volume = Volume FilePath
- data Device = Device {
- pathOnHost :: FilePath
- pathInContainer :: FilePath
- cgroupPermissions :: Text
- type ContainerName = Text
- data VolumeFrom = VolumeFrom ContainerName (Maybe VolumePermission)
- data Link = Link Text (Maybe Text)
- data LogDriverType
- data LogDriverOption = LogDriverOption Name Value
- data LogDriverConfig = LogDriverConfig LogDriverType [LogDriverOption]
- data NetworkMode
- data PortType
- data Network = Network NetworkMode NetworkOptions
- data NetworkSettings = NetworkSettings {
- networkSettingsBridge :: Text
- networkSettingsSandboxId :: Text
- networkSettingsHairpinMode :: Bool
- networkSettingsLinkLocalIPv6Address :: Text
- networkSettingsLinkLocalIPv6PrefixLen :: Int
- networkSettingsPorts :: [PortBinding]
- networkSettingsSandboxKey :: Text
- networkSettingsSecondaryIPAddresses :: Maybe [Text]
- networkSettingsSecondaryIPv6Addresses :: Maybe [Text]
- networkSettingsEndpointID :: Text
- networkSettingsGateway :: Text
- networkSettingsGlobalIPv6Address :: Text
- networkSettingsGlobalIPv6PrefixLen :: Int
- networkSettingsIpAddress :: Text
- networkSettingsIpPrefixLen :: Int
- networkSettingsIpv6Gateway :: Text
- networkSettingsMacAddress :: Text
- networkSettingsNetworks :: [Network]
- data NetworkOptions = NetworkOptions {
- networkOptionsId :: Text
- networkOptionsEndpointId :: Text
- networkOptionsGateway :: Text
- networkOptionsIpAddress :: Text
- networkOptionsIpPrefixLen :: Int
- networkOptionsIpV6Gateway :: Maybe Text
- networkOptionsGlobalIPv6Address :: Maybe Text
- networkOptionsGlobalIPv6PrefixLen :: Maybe Int
- networkOptionsMacAddress :: Text
- data Mount = Mount {
- mountName :: Text
- mountSource :: FilePath
- mountDestination :: FilePath
- mountDriver :: Text
- mountMode :: Maybe VolumePermission
- mountRW :: Bool
- mountPropogation :: Text
- data PortBinding = PortBinding {}
- data HostPort = HostPort {}
- type RetryCount = Integer
- data RestartPolicy
- data Isolation
- newtype UTSMode = UTSMode Text
- data HostConfig = HostConfig {
- binds :: [Bind]
- containerIDFile :: Maybe FilePath
- logConfig :: LogDriverConfig
- networkMode :: NetworkMode
- portBindings :: [PortBinding]
- restartPolicy :: RestartPolicy
- volumeDriver :: Maybe Text
- volumesFrom :: [VolumeFrom]
- capAdd :: [Text]
- capDrop :: [Text]
- dns :: [Text]
- dnsOptions :: [Text]
- dnsSearch :: [Text]
- extraHosts :: [Text]
- ipcMode :: Maybe Text
- links :: [Link]
- oomScoreAdj :: Maybe Integer
- privileged :: Bool
- publishAllPorts :: Bool
- readonlyRootfs :: Bool
- securityOpt :: [Text]
- shmSize :: Maybe Integer
- resources :: ContainerResources
- defaultHostConfig :: HostConfig
- data Ulimit = Ulimit {
- ulimitName :: Text
- ulimitSoft :: Integer
- ulimitHard :: Integer
- data ContainerResources = ContainerResources {
- cpuShares :: Maybe Integer
- blkioWeight :: Maybe Integer
- blkioWeightDevice :: Maybe [DeviceWeight]
- blkioDeviceReadBps :: Maybe [DeviceRate]
- blkioDeviceWriteBps :: Maybe [DeviceRate]
- blkioDeviceReadIOps :: Maybe [DeviceRate]
- blkioDeviceWriteIOps :: Maybe [DeviceRate]
- cpuPeriod :: Maybe Integer
- cpusetCpus :: Maybe Text
- cpusetMems :: Maybe Text
- devices :: [Device]
- kernelMemory :: Maybe MemoryConstraint
- memory :: Maybe MemoryConstraint
- memoryReservation :: Maybe MemoryConstraint
- memorySwap :: Maybe MemoryConstraint
- oomKillDisable :: Bool
- ulimits :: [Ulimit]
- defaultContainerResources :: ContainerResources
- type Port = Integer
- type Name = Text
- type Value = Text
- data EnvVar = EnvVar Name Value
- data ContainerConfig = ContainerConfig {
- hostname :: Maybe Text
- domainname :: Maybe Text
- user :: Maybe Text
- attachStdin :: Bool
- attachStdout :: Bool
- attachStderr :: Bool
- exposedPorts :: [ExposedPort]
- tty :: Bool
- openStdin :: Bool
- stdinOnce :: Bool
- env :: [EnvVar]
- cmd :: [Text]
- image :: Text
- volumes :: [Volume]
- workingDir :: Maybe FilePath
- entrypoint :: Maybe Text
- networkDisabled :: Maybe Bool
- macAddress :: Maybe Text
- labels :: [Label]
- stopSignal :: Signal
- defaultContainerConfig :: Text -> ContainerConfig
- data ExposedPort = ExposedPort Port PortType
- data DeviceWeight = DeviceWeight {
- deviceWeightPath :: FilePath
- deviceWeightWeight :: Text
- data DeviceRate = DeviceRate {
- deviceRatePath :: FilePath
- deviceRateRate :: Text
- addPortBinding :: PortBinding -> CreateOpts -> CreateOpts
- addExposedPort :: ExposedPort -> CreateOpts -> CreateOpts
- addBind :: Bind -> CreateOpts -> CreateOpts
- setCmd :: Text -> CreateOpts -> CreateOpts
- addLink :: Link -> CreateOpts -> CreateOpts
- addVolume :: Volume -> CreateOpts -> CreateOpts
- addVolumeFrom :: VolumeFrom -> CreateOpts -> CreateOpts
- data MemoryConstraint = MemoryConstraint Integer MemoryConstraintSize
- data MemoryConstraintSize
Documentation
List of Docker Engine API endpoints
VersionEndpoint | |
ListContainersEndpoint ListOpts | |
ListImagesEndpoint ListOpts | |
CreateContainerEndpoint CreateOpts (Maybe ContainerName) | |
StartContainerEndpoint StartOpts ContainerID | |
StopContainerEndpoint Timeout ContainerID | |
WaitContainerEndpoint ContainerID | |
KillContainerEndpoint Signal ContainerID | |
RestartContainerEndpoint Timeout ContainerID | |
PauseContainerEndpoint ContainerID | |
UnpauseContainerEndpoint ContainerID | |
ContainerLogsEndpoint LogOpts Bool ContainerID | Second argument (Bool) is whether to follow which is currently hardcoded to False.
See note in |
DeleteContainerEndpoint DeleteOpts ContainerID | |
InspectContainerEndpoint ContainerID | |
BuildImageEndpoint BuildOpts FilePath | |
CreateImageEndpoint Text Tag (Maybe Text) | Either pull an image from docker hub or imports an image from a tarball (or URL) |
type ApiVersion = Text Source #
We should newtype this
data ContainerID Source #
ID of a contianer
Eq ContainerID Source # | |
Show ContainerID Source # | |
ToJSON ContainerID Source # | |
FromJSON ContainerID Source # | |
fromContainerID :: ContainerID -> Text Source #
Used for extracting the id of the container from the newtype
toContainerID :: Text -> Maybe ContainerID Source #
Used for parsing a Text value into a ContainerID. We apply some basic validation here.
fromImageID :: ImageID -> Text Source #
Used for extracting the id of the image from the newtype.
toImageID :: Text -> Maybe ImageID Source #
Helper function used for parsing a Text value into an ImageID. For now just basic validation is used.
Timeout used for stopping a container. DefaultTimeout is 10 seconds.
Signal used for sending to the process running in the container. The default signal is SIGTERM.
data ContainerDetails Source #
ContainerDetails | |
|
data DockerClientOpts Source #
Client options used to configure the remote engine we're talking to
Eq DockerClientOpts Source # | |
Show DockerClientOpts Source # | |
Monad m => MonadReader (DockerClientOpts, HttpHandler m) (DockerT m) # | |
defaultClientOpts :: DockerClientOpts Source #
Default DockerClientOpts used for talking to the docker engine.
List options used for filtering the list of container or images.
defaultListOpts :: ListOpts Source #
Default ListOpts. Doesn't list stopped containers.
data DockerVersion Source #
Data type used for represneting the version of the docker engine remote API.
DockerVersion | |
|
Eq DockerVersion Source # | |
Show DockerVersion Source # | |
Generic DockerVersion Source # | |
ToJSON DockerVersion Source # | |
FromJSON DockerVersion Source # | |
type Rep DockerVersion Source # | |
data ContainerPortInfo Source #
Data type used for representing the information of various ports that a contianer may expose.
ContainerPortInfo | |
|
Data type used for parsing a list of containers.
Container | |
|
data ContainerState Source #
Data type used for parsing the container state from a list of containers.
Eq ContainerState Source # | |
Show ContainerState Source # | |
Generic ContainerState Source # | |
FromJSON ContainerState Source # | |
type Rep ContainerState Source # | |
Represents the status of the container life cycle.
Alias for representing a RepoDigest. We could newtype this and add some validation.
Container and Image Labels.
Data type used for parsing information from a list of images.
DockerImage | |
|
dropImagePrefix :: [a] -> [a] Source #
Helper function used for dropping the "image" prefix when serializing the Image data type to and from json.
data CreateOpts Source #
Options used for creating a Container.
Eq CreateOpts Source # | |
Show CreateOpts Source # | |
ToJSON CreateOpts Source # | |
Options for when building images from a Dockerfile
BuildOpts | |
|
defaultBuildOpts :: Text -> BuildOpts Source #
defaultCreateOpts :: Text -> CreateOpts Source #
Default create options when creating a container. You only need to specify an image name and the rest is all sensible defaults.
data DetachKeys Source #
Options for starting a container.
defaultStartOpts :: StartOpts Source #
Default options for staring a container.
data DeleteOpts Source #
Options for deleting a container.
DeleteOpts | |
|
defaultDeleteOpts :: DeleteOpts Source #
Default options for deleting a container. Most of the time we DON'T want to delete the container's volumes or force delete it if it's running.
data TailLogOpt Source #
Used for requesting N number of lines when tailing a containers log output.
Log options used when requesting the log output from a container.
defaultLogOpts :: LogOpts Source #
Sensible default for log options.
data VolumePermission Source #
Set permissions on volumes that you mount in the container.
Eq VolumePermission Source # | |
Show VolumePermission Source # | |
Generic VolumePermission Source # | |
ToJSON VolumePermission Source # | |
FromJSON VolumePermission Source # | |
type Rep VolumePermission Source # | |
Bind | |
|
Used for marking a directory in the container as "exposed" hence
taking it outside of the COW filesystem and making it mountable
in other containers using VolumesFrom. The volume usually get's
created somewhere in varlibdockervolumes
(depending on the volume
driver used).
The CLI example is:
docker run --name app -v /opt/data -it myapp:latest docker run --name app2 --volumes-from app /bin/bash -c "ls -l /opt/data"
Device | |
|
type ContainerName = Text Source #
data VolumeFrom Source #
Eq VolumeFrom Source # | |
Show VolumeFrom Source # | |
ToJSON VolumeFrom Source # | |
FromJSON VolumeFrom Source # | |
data LogDriverType Source #
Eq LogDriverType Source # | |
Show LogDriverType Source # | |
ToJSON LogDriverType Source # | |
FromJSON LogDriverType Source # | |
data LogDriverOption Source #
Eq LogDriverOption Source # | |
Show LogDriverOption Source # | |
ToJSON [LogDriverOption] Source # | |
FromJSON [LogDriverOption] Source # | |
data LogDriverConfig Source #
Eq LogDriverConfig Source # | |
Show LogDriverConfig Source # | |
ToJSON LogDriverConfig Source # | |
FromJSON LogDriverConfig Source # | |
data NetworkMode Source #
Eq NetworkMode Source # | |
Ord NetworkMode Source # | |
Show NetworkMode Source # | |
ToJSON NetworkMode Source # | |
FromJSON NetworkMode Source # | |
data NetworkSettings Source #
Data type reprsenting the various network settings a container can have.
NetworkSettings | |
|
Eq NetworkSettings Source # | |
Show NetworkSettings Source # | |
FromJSON NetworkSettings Source # | |
data NetworkOptions Source #
Data type used for parsing the network information of each container when listing them.
NetworkOptions | |
|
Eq NetworkOptions Source # | |
Show NetworkOptions Source # | |
FromJSON NetworkOptions Source # | |
Data type used for parsing the mount information from a container list.
Mount | |
|
data PortBinding Source #
This datastructure models mapping a Port from the container onto the host system s that the service running in the container can be accessed from the outside world. We either map a port onto all interfaces (default) or onto a specific interface like `127.0.0.1`. NOTE: We should disallow duplicate port bindings as the ToJSON instance will only send the last one. { port/protocol: [{ HostPort: "port" }] }
Eq PortBinding Source # | |
Show PortBinding Source # | |
ToJSON [PortBinding] Source # | |
FromJSON [PortBinding] Source # | |
type RetryCount = Integer Source #
data RestartPolicy Source #
Eq RestartPolicy Source # | |
Show RestartPolicy Source # | |
ToJSON RestartPolicy Source # | |
FromJSON RestartPolicy Source # | |
data HostConfig Source #
HostConfig | |
|
Eq HostConfig Source # | |
Show HostConfig Source # | |
Generic HostConfig Source # | |
ToJSON HostConfig Source # | |
FromJSON HostConfig Source # | |
type Rep HostConfig Source # | |
defaultHostConfig :: HostConfig Source #
Default host confiratuon used for creating a container.
Ulimit | |
|
data ContainerResources Source #
ContainerResources | |
|
data ContainerConfig Source #
ContainerConfig | |
|
Eq ContainerConfig Source # | |
Show ContainerConfig Source # | |
Generic ContainerConfig Source # | |
ToJSON ContainerConfig Source # | |
FromJSON ContainerConfig Source # | |
type Rep ContainerConfig Source # | |
defaultContainerConfig :: Text -> ContainerConfig Source #
Container configuration used for creating a container with sensible defaults.
data ExposedPort Source #
ExposedPort represents a port (and it's type)
that a container should expose to other containers or the host system.
NOTE
: This does not automatically expose the port onto the host
system but rather it just tags it. It's best to be used with
the PublishAllPorts flag. It is also useful for
the daemon to know which Environment variables to
inject into a container linking to our container.
Example linking a Postgres container named db would inject the following
environment variables automatically if we set the corresponding
ExposedPort:
DB_PORT_5432_TCP_PORT="5432" DB_PORT_5432_TCP_PROTO="tcp" DB_PORT_5432_TCP="tcp://172.17.0.1:5432"
Eq ExposedPort Source # | |
Show ExposedPort Source # | |
ToJSON [ExposedPort] Source # | |
FromJSON [ExposedPort] Source # | |
data DeviceWeight Source #
DeviceWeight | |
|
Eq DeviceWeight Source # | |
Show DeviceWeight Source # | |
ToJSON DeviceWeight Source # | |
FromJSON DeviceWeight Source # | |
data DeviceRate Source #
DeviceRate | |
|
Eq DeviceRate Source # | |
Show DeviceRate Source # | |
ToJSON DeviceRate Source # | |
FromJSON DeviceRate Source # | |
addPortBinding :: PortBinding -> CreateOpts -> CreateOpts Source #
A convenience function that adds PortBindings to and exiting
CreateOpts record. Useful with defaultCreateOpts
Example:
>>>
let pb = PortBinding 80 TCP [HostPort "0.0.0.0" 8000]
>>>
addPortBinding pb $ defaultCreateOpts "nginx:latest"
addExposedPort :: ExposedPort -> CreateOpts -> CreateOpts Source #
Helper function for adding a ExposedPort to and existing CreateOpts record.
addBind :: Bind -> CreateOpts -> CreateOpts Source #
A helper function to more easily add a bind mount to existing CreateOpts records.
setCmd :: Text -> CreateOpts -> CreateOpts Source #
Helper function for adding a Command to and existing CreateOpts record.
addLink :: Link -> CreateOpts -> CreateOpts Source #
Helper function for adding a Link to and existing CreateOpts record.
addVolume :: Volume -> CreateOpts -> CreateOpts Source #
Helper function for adding a Volume to and existing CreateOpts record.
addVolumeFrom :: VolumeFrom -> CreateOpts -> CreateOpts Source #
Helper function for adding a VolumeFrom to and existing CreateOpts record.
data MemoryConstraint Source #
Eq MemoryConstraint Source # | |
Show MemoryConstraint Source # | |
ToJSON MemoryConstraint Source # | |
FromJSON MemoryConstraint Source # | |