docker-0.3.0.0: An API client for docker written in Haskell

Safe HaskellNone
LanguageHaskell2010

Docker.Client.Api

Contents

Synopsis

Containers

listContainers :: forall m. Monad m => ListOpts -> DockerT m (Either DockerError [Container]) Source #

Lists all running docker containers. Pass in defaultListOpts {all = True} to get a list of stopped containers as well.

createContainer :: forall m. Monad m => CreateOpts -> Maybe ContainerName -> DockerT m (Either DockerError ContainerID) Source #

Creates a docker container but does not start it. See CreateOpts for a list of options and you can use defaultCreateOpts for some sane defaults.

startContainer :: forall m. Monad m => StartOpts -> ContainerID -> DockerT m (Either DockerError ()) Source #

Start a container from a given ContainerID that we get from createContainer. See StartOpts for a list of configuration options for starting a container. Use defaultStartOpts for sane defaults.

stopContainer :: forall m. Monad m => Timeout -> ContainerID -> DockerT m (Either DockerError ()) Source #

Attempts to stop a container with the given ContainerID gracefully (SIGTERM). The docker daemon will wait for the given Timeout and then send a SIGKILL killing the container.

killContainer :: forall m. Monad m => Signal -> ContainerID -> DockerT m (Either DockerError ()) Source #

Sends a Signal to the container with the given ContainerID. Same as stopContainer but you choose the signal directly.

restartContainer :: forall m. Monad m => Timeout -> ContainerID -> DockerT m (Either DockerError ()) Source #

Restarts a container with the given ContainerID.

pauseContainer :: forall m. Monad m => ContainerID -> DockerT m (Either DockerError ()) Source #

Pauses a container with the given ContainerID.

unpauseContainer :: forall m. Monad m => ContainerID -> DockerT m (Either DockerError ()) Source #

Unpauses a container with the given ContainerID.

deleteContainer :: forall m. Monad m => DeleteOpts -> ContainerID -> DockerT m (Either DockerError ()) Source #

Deletes a container with the given ContainerID. See DeleteOpts for options and use defaultDeleteOpts for sane defaults.

getContainerLogs :: forall m. Monad m => LogOpts -> ContainerID -> DockerT m (Either DockerError ByteString) Source #

Get's container's logs for a given ContainerID. This will only work with the JsonFile LogDriverType as the other driver types disable this endpoint and it will return a DockerError.

See LogOpts for options that you can pass and defaultLogOpts for sane defaults.

NOTE: Currently streaming logs is not supported and this 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.

The recommended method is to use one of the other LogDriverTypes available (like syslog) for creating your containers.

Images

listImages :: forall m. Monad m => ListOpts -> DockerT m (Either DockerError [Image]) Source #

Lists all docker images.

Other

getDockerVersion :: forall m. Monad m => DockerT m (Either DockerError DockerVersion) Source #

Gets the version of the docker engine remote API.