8      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None"#36;<=>?KQV~AwExposedPort 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: cDB_PORT_5432_TCP_PORT="5432" DB_PORT_5432_TCP_PROTO="tcp" DB_PORT_5432_TCP="tcp://172.17.0.1:5432" nThis 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`. NOTEe: We should disallow duplicate port bindings as the ToJSON instance will only send the last one. {  port/ protocol: [{ HostPort: " port" }] }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  VolumesFrom1. 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" ;Set permissions on volumes that you mount in the container.ALog options used when requesting the log output from a container.LUsed for requesting N number of lines when tailing a containers log output.Timestamp alias.2Options for when building images from a Dockerfile9Image name in the form of name:tag; ie. myimage:latest.:w(Name of dockerfile (default: Dockerfile))Do not use cache when building the image.GRemove intermediate containers after a successful build (default true).&Always remove intermediate containers.VAlways attempt to pull a newer version of the *parent* image (ie. FROM debian:jessie).!Options for deleting a container.AAutomatically cleanup volumes that the container created as well.8If the container is still running force deletion anyway.!Options for starting a container.aOverride the key sequence for detaching a container. Format is a single character [a-Z] or ctrl- value where  value! is one of: a-z, @, ^, [, , or _.&Options used for creating a Container.=Data type used for parsing information from a list of images.Alias for Tags.Container and Image Labels.TAlias for representing a RepoDigest. We could newtype this and add some validation.1Represents the state of the container life cycle.0Data type used for parsing a list of containers.HData type reprsenting the various network settings a container can have.XData type used for parsing the network information of each container when listing them.^Data type used for representing the information of various ports that a contianer may expose. MData type used for represneting the version of the docker engine remote API.@List options used for filtering the list of container or images.CClient options used to configure the remote engine we're talking toJData type used for parsing the container state from a list of containers.(HData type used for parsing the mount information from a container list.F`Signal used for sending to the process running in the container. The default signal is SIGTERM.QDTimeout used for stopping a container. DefaultTimeout is 10 seconds.UID of a contianerVWe should newtype thisWWe should newtype thisX#List of Docker Engine API endpointsd`Second argument (Bool) is whether to follow which is currently hardcoded to False. See note in  for explanation why.hPEither pull an image from docker hub or imports an image from a tarball (or URL)i<Used for extracting the id of the container from the newtypejWUsed for parsing a Text value into a ContainerID. We apply some basic validation here.k9Used for extracting the id of the image from the newtype.lfHelper function used for parsing a Text value into an ImageID. For now just basic validation is used.mDefault DockerClientOpts' used for talking to the docker engine.nDefault ListOpts". Doesn't list stopped containers.olHelper function used for dropping the "image" prefix when serializing the Image data type to and from json.pNContainer configuration used for creating a container with sensible defaults.q7Default host confiratuon used for creating a container.sDefault create options when creating a container. You only need to specify an image name and the rest is all sensible defaults.t(Default options for staring a container.vDefault 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.w!Sensible default for log options.x?A helper function to more easily add a bind mount to existing  CreateOpts records.yHHelper function for adding a Command to and existing CreateOpts record.zHelper function for adding a Link$ to and existing CreateOpts record.{Helper function for adding a Volume$ to and existing CreateOpts record.|Helper function for adding a  VolumeFrom$ to and existing CreateOpts record.}>A convenience function that adds PortBindings to and exiting  CreateOpts record. Useful with s Example:5let pb = PortBinding 80 TCP [HostPort "0.0.0.0" 8000]4addPortBinding pb $ defaultCreateOpts "nginx:latest"~Helper function for adding a  ExposedPort$ to and existing CreateOpts record.pHelper function for converting a data type [a] to a json dictionary like so {"something": {}, "something2": {}}xHelper function for converting a data type [a] to a json dictionary like so {"something": "val1", "something2": "val2"}4Helper function that return an empty dictionary "{}"   -!"#$%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bacdhefgijklmnopqrstuvwxyz{|}~     ' !"#$%&()*+,-./01@>23456789:;<=?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~XYZ[\]^_`abcdefghWVUijTklQRSOPFGHIJKLMN0123456789:;<=>?@ABCDEmn      !"#$%&'oustvw}~{|vwxyzstu()*+,-./nopqrjklmidefgh`abc^_EFGHIJKLMNOPQRSTUVWXYZ[\]q@ABCD !"#$%&'()*+,-./01r p<=>?89:;}~xyz{|2345676  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghjklmnopqrstuvwxyz{|}~           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUXYZ[\]^_`abcdefghNone 36;<=>?KQV@ABCDE@ABCDENone 36;<=>?KQVWM6Could not parse the response from the Docker endpoint.N0Invalid exit code received from Docker endpoint.YYConnect to a unix domain socket (the default docker socket is at /var/run/docker.sock)Docker seems to ignore the hostname in requests sent over unix domain sockets (and the port obviously doesn't matter either)YThe socket to connect toFGHIONMLKJPQRSTUVWXYZ[\TSRPQIJKLMNOFGHa`_^]UVWXYZ[\FGHIJKLMNOPQNone 36;<=>?KQVdefgihjklmnopqrstuvwxypnolmjkfghideqrstuvwxydefghijklmnoNone 36;<=>?KQVa1Gets the version of the docker engine remote API.-Lists all running docker containers. Pass in n {all = True}- to get a list of stopped containers as well.Lists all docker images.$Creates a docker container but does not start it. See ' for a list of options and you can use s for some sane defaults.Start a container from a given U that we get from . See D for a list of configuration options for starting a container. Use t for sane defaults.,Attempts to stop a container with the given UC gracefully (SIGTERM). The docker daemon will wait for the given Q0 and then send a SIGKILL killing the container.(Blocks until a container with the given U# stops, then returns the exit codeSends a F! to the container with the given U . Same as $ but you choose the signal directly.$Restarts a container with the given U."Pauses a container with the given U.$Unpauses a container with the given U.#Deletes a container with the given U. See  DeleteOpts for options and use v for sane defaults.Gets 0 for a given U.#Get's container's logs for a given U . This will only work with the  G as the other driver types disable this endpoint and it will return a I.See $ for options that you can pass and w for sane defaults.NOTE: his function will fetch the entire log that the container produced in the json-file on disk. Depending on the logging setup of the process in your container this can be a significant amount which might block your application...so use with caution.HIf you want to stream the logs from the container continuosly then use NOTE+: It's recommended to use one of the other 8s available (like syslog) for creating your containers.AContinuously gets the container's logs as a stream. Uses conduit.Example: >>> import Docker.Client >>> import Data.Maybe >>> import Conduit >>> h <- defaultHttpHanlder >>> let cid = fromJust $ toContainerID "fee86e1d522b" >>> runDockerT (defaultClientOpts, h) $ getContainerLogsStream defaultLogOpts cid stdoutC  Build an Image from a DockerfileTODO: Add X-Registry-Config1TODO: Add support for remote URLs to a Dockerfile8TODO: Clean up temp tar.gz file after the image is built,Pulls an image from Docker Hub (by default).RTODO: Add support for X-Registry-Auth and pulling from private docker registries.TODO: Implement importImage function that uses he same CreateImageEndpoint but rather than pulling from docker hub it imports the image from a tarball or a URL.(c) Deni Bertovic, 2014BSD3deni@denibertovic.com experimentalPOSIXNone 36;<=>?KQVÒ   -!"#$%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bacdhefgijklmnopqrstuvwxyz{|}~     ' !"#$%&()*+,-./01@>23456789:;<=?ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~FGHIJKLMNOPQRSTUVWXYZ[\      !"##$%&'()*+,-./01234556789::;<==>?@@ABCDDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefgghijjklmnopqrstuvvwwxyz{|}~       !"#$%&'()*+,-./012233456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&''()*+,-./00123456789:;<=>?@ABCCDDEFGGHHIIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn56o%docker-0.5.1.1-5svZzUN7M0wD5RJydjB2hODocker.Client.TypesDocker.Client.InternalDocker.Client.HttpDocker.Client.UtilsDocker.Client.ApigetContainerLogs Docker.ClientContainerConfighostname domainnameuser attachStdin attachStdout attachStderr exposedPortstty openStdin stdinOnceenvcmdimagevolumes workingDir entrypointnetworkDisabled macAddresslabels stopSignal Entrypoint ExposedPortEnvVarValueNamePortContainerResources cpuShares blkioWeightblkioWeightDeviceblkioDeviceReadBpsblkioDeviceWriteBpsblkioDeviceReadIOpsblkioDeviceWriteIOps cpuPeriod cpusetCpus cpusetMemsdevices kernelMemorymemorymemoryReservation memorySwapoomKillDisableulimitsMemoryConstraintMemoryConstraintSizeBMBGB DeviceRatedeviceRatePathdeviceRateRate DeviceWeightdeviceWeightPathdeviceWeightWeightUlimit ulimitName ulimitSoft ulimitHard HostConfigbindscontainerIDFile logConfig networkMode portBindings restartPolicy volumeDriver volumesFromcapAddcapDropdns dnsOptions dnsSearch extraHostsipcModelinks oomScoreAdj privilegedpublishAllPortsreadonlyRootfs securityOptshmSize resourcesUTSMode IsolationDefaultProcessHyperv RestartPolicy RestartAlwaysRestartUnlessStoppedRestartOnFailure RestartOff RetryCountHostPorthostIphostPost PortBinding containerPortportType hostPortsPortTypeTCPUDP NetworkMode NetworkBridge NetworkHostNetworkDisabled NetworkNamedLogDriverConfigLogDriverOption LogDriverTypeJsonFileSyslogJournaldGelfFluentdAwsLogsSplunkEtwlogsLoggingDisabledLink VolumeFrom ContainerNameDevice pathOnHostpathInContainercgroupPermissionsBindhostSrc containerDestvolumePermissionVolumeVolumePermission ReadWriteReadOnlyLogOptsstdoutstderrsince timestampstail TailLogOptTailAll Timestamp BuildOptsbuildImageNamebuildDockerfileName buildQuiet buildNoCachebuildRemoveItermediatebuildForceRemoveIntermediatebuildPullParent DeleteOpts deleteVolumesforce StartOpts detachKeys DetachKeysWithCtrl WithoutCtrlDefaultDetachKey CreateOptscontainerConfig hostConfigImage DockerImageimageId imageCreated imageParentId imageRepoTagsimageRepoDigests imageSizeimageVirtualSize imageLabelsTagLabelDigestStateCreated RestartingRunningPausedExitedDead Container containerIdcontainerNamescontainerImageNamecontainerImageIdcontainerCommandcontainerCreatedAtcontainerStatecontainerStatuscontainerPortscontainerLabelscontainerNetworkscontainerMountsNetworkSettingsnetworkSettingsBridgenetworkSettingsSandboxIdnetworkSettingsHairpinMode#networkSettingsLinkLocalIPv6Address%networkSettingsLinkLocalIPv6PrefixLennetworkSettingsPortsnetworkSettingsSandboxKey#networkSettingsSecondaryIPAddresses%networkSettingsSecondaryIPv6AddressesnetworkSettingsEndpointIDnetworkSettingsGateway networkSettingsGlobalIPv6Address"networkSettingsGlobalIPv6PrefixLennetworkSettingsIpAddressnetworkSettingsIpPrefixLennetworkSettingsIpv6GatewaynetworkSettingsMacAddressnetworkSettingsNetworksNetworkNetworkOptionsnetworkOptionsIdnetworkOptionsEndpointIdnetworkOptionsGatewaynetworkOptionsIpAddressnetworkOptionsIpPrefixLennetworkOptionsIpV6GatewaynetworkOptionsGlobalIPv6Address!networkOptionsGlobalIPv6PrefixLennetworkOptionsMacAddressContainerPortInfo ipAddressInfoprivatePortInfopublicPortInfo portTypeInfo DockerVersionversion apiVersion gitCommit goVersionosarch kernelVersion buildTimeListOptsallDockerClientOptsapiVerbaseUrlContainerStatecontainerErrorexitCode finishedAt oomKilleddeadpausedpid restartingrunning startedAtstateMount mountName mountSourcemountDestination mountDrivermountRWmountPropogationContainerDetailsappArmorProfileargscontainerDetailsConfigcreateddrivercontainerDetailsHostConfig hostnamePath hostsPathlogPathcontainerDetailsIdcontainerDetailsImage mountLabelnamenetworkSettingspath processLabelresolveConfPath restartCountcontainerDetailsStatemountsSignalSIGHUPSIGINTSIGQUITSIGSTOPSIGTERMSIGUSR1SIGSIGKILL StatusCodeTimeoutDefaultTimeoutImageID ContainerID ApiVersionURLEndpointVersionEndpointListContainersEndpointListImagesEndpointCreateContainerEndpointStartContainerEndpointStopContainerEndpointWaitContainerEndpointKillContainerEndpointRestartContainerEndpointPauseContainerEndpointUnpauseContainerEndpointContainerLogsEndpointDeleteContainerEndpointInspectContainerEndpointBuildImageEndpointCreateImageEndpointfromContainerID toContainerID fromImageID toImageIDdefaultClientOptsdefaultListOptsdropImagePrefixdefaultContainerConfigdefaultHostConfigdefaultContainerResourcesdefaultCreateOptsdefaultStartOptsdefaultBuildOptsdefaultDeleteOptsdefaultLogOptsaddBindsetCmdaddLink addVolume addVolumeFromaddPortBindingaddExposedPort$fFromJSONContainerID$fToJSONContainerID$fFromJSONImageID$fToJSONImageID$fFromJSONStatusCode$fToJSONStatusCode$fToJSONSignal$fFromJSONSignal$fFromJSONMount$fFromJSONDockerVersion$fToJSONDockerVersion$fFromJSONNetworkOptions$fFromJSONState$fFromJSONContainerState$fFromJSONVolumePermission$fToJSONVolumePermission $fFromJSON[] $fToJSON[] $fToJSONBind$fFromJSONBind$fFromJSONDevice$fToJSONDevice$fToJSONVolumeFrom$fFromJSONVolumeFrom $fToJSONLink$fFromJSONLink$fToJSONLogDriverType$fFromJSONLogDriverType$fToJSONNetworkMode$fFromJSONNetworkMode $fFromJSON[]0$fFromJSONPortType$fToJSONPortType$fShowPortType$fToJSONRestartPolicy$fFromJSONRestartPolicy$fToJSONUlimit$fFromJSONUlimit$fToJSONDeviceWeight$fFromJSONDeviceWeight$fToJSONDeviceRate$fFromJSONDeviceRate$fFromJSONMemoryConstraint$fToJSONMemoryConstraint$fFromJSONContainerResources$fFromJSONHostPort$fToJSONHostPort $fToJSON[]0 $fFromJSON[]1$fFromJSONNetworkSettings$fFromJSONContainerPortInfo $fFromJSON[]2 $fToJSON[]1$fFromJSONLogDriverConfig$fToJSONLogDriverConfig$fToJSONHostConfig$fFromJSONHostConfig $fFromJSON[]3 $fToJSON[]2$fFromJSONImage$fFromJSONContainer$fToJSONEnvVar$fFromJSONEnvVar $fToJSON[]3 $fFromJSON[]4$fFromJSONEntrypoint$fToJSONEntrypoint$fFromJSONContainerConfig$fToJSONContainerConfig$fToJSONCreateOpts$fFromJSONContainerDetails$fEqContainerID$fShowContainerID $fEqImageID $fShowImageID $fEqTimeout $fShowTimeout $fEqSignal $fShowSignal $fEqMount $fShowMount$fGenericMount$fEqDockerClientOpts$fShowDockerClientOpts $fEqListOpts$fShowListOpts$fShowDockerVersion$fEqDockerVersion$fGenericDockerVersion$fEqNetworkOptions$fShowNetworkOptions $fEqState $fShowState$fGenericState$fEqContainerState$fShowContainerState$fGenericContainerState$fEqDetachKeys$fShowDetachKeys $fEqStartOpts$fShowStartOpts$fEqDeleteOpts$fShowDeleteOpts $fEqBuildOpts$fShowBuildOpts$fEqTailLogOpt$fShowTailLogOpt $fEqLogOpts $fShowLogOpts$fEqVolumePermission$fShowVolumePermission$fGenericVolumePermission $fEqVolume $fShowVolume$fEqBind $fShowBind $fEqDevice $fShowDevice$fGenericDevice$fEqVolumeFrom$fShowVolumeFrom$fEqLink $fShowLink$fEqLogDriverType$fShowLogDriverType$fEqNetworkMode$fShowNetworkMode$fOrdNetworkMode $fEqNetwork $fShowNetwork $fEqPortType$fGenericPortType$fReadPortType $fOrdPortType$fEqRestartPolicy$fShowRestartPolicy $fEqIsolation$fShowIsolation $fEqUTSMode $fShowUTSMode $fEqUlimit $fShowUlimit$fGenericUlimit$fShowDeviceWeight$fEqDeviceWeight$fShowDeviceRate$fEqDeviceRate$fEqMemoryConstraintSize$fShowMemoryConstraintSize$fEqMemoryConstraint$fShowMemoryConstraint$fEqContainerResources$fShowContainerResources$fGenericContainerResources $fEqHostPort$fShowHostPort$fEqPortBinding$fShowPortBinding$fEqNetworkSettings$fShowNetworkSettings$fEqContainerPortInfo$fShowContainerPortInfo$fEqLogDriverOption$fShowLogDriverOption$fEqLogDriverConfig$fShowLogDriverConfig$fEqHostConfig$fShowHostConfig$fGenericHostConfig $fEqLabel $fShowLabel $fShowImage $fEqImage$fGenericImage$fShowContainer $fEqContainer $fEqEnvVar $fShowEnvVar$fEqExposedPort$fShowExposedPort$fEqEntrypoint$fShowEntrypoint$fGenericEntrypoint$fEqContainerConfig$fShowContainerConfig$fGenericContainerConfig$fEqCreateOpts$fShowCreateOpts $fEqEndpoint$fShowEndpoint$fEqContainerDetails$fShowContainerDetails$fGenericContainerDetails encodeURLencodeURLWithQueryencodeQ getEndpointgetEndpointRequestBodygetEndpointContentTypeDockerT unDockerT DockerErrorDockerConnectionErrorDockerInvalidRequestDockerClientErrorDockerClientDecodeErrorDockerInvalidStatusCodeGenericDockerError HttpHandlerHttpVerbResponseRequest runDockerT mkHttpRequestdefaultHttpHandler httpHandlerunixHttpHandler$clientParamsWithClientAuthenticationclientParamsSetCAstatusCodeToError$fMonadIODockerT$fMonadTransDockerT$fMonadReader(,)DockerT$fMonadDockerT$fApplicativeDockerT$fShowDockerError$fFunctorDockerTBuildContextRootDir DockerIgnoreexclusionPatternsinclusionPatternsInclusionPatternExclusionPatternDirTreeFilemakeBuildContextmakeBuildContext'parseDockerIgnoreFilegetBuildContext shouldInclude shouldRecursedockerIgnoreDecisionexclusionCheckinclusionCheck$fEqExclusionPattern$fShowExclusionPattern$fEqInclusionPattern$fShowInclusionPattern$fEqDockerIgnore$fShowDockerIgnore$fEqBuildContextRootDir$fShowBuildContextRootDirgetDockerVersionlistContainers listImagescreateContainerstartContainer stopContainer waitContainer killContainerrestartContainerpauseContainerunpauseContainerdeleteContainerinspectContainergetContainerLogsStreambuildImageFromDockerfile pullImage toJsonKey toJsonKeyValemptyJsonObject