Safe Haskell | None |
---|---|
Language | Haskell2010 |
- listContainers :: forall m. Monad m => ListOpts -> DockerT m (Either DockerError [Container])
- createContainer :: forall m. Monad m => CreateOpts -> Maybe ContainerName -> DockerT m (Either DockerError ContainerID)
- startContainer :: forall m. Monad m => StartOpts -> ContainerID -> DockerT m (Either DockerError ())
- stopContainer :: forall m. Monad m => Timeout -> ContainerID -> DockerT m (Either DockerError ())
- killContainer :: forall m. Monad m => Signal -> ContainerID -> DockerT m (Either DockerError ())
- restartContainer :: forall m. Monad m => Timeout -> ContainerID -> DockerT m (Either DockerError ())
- pauseContainer :: forall m. Monad m => ContainerID -> DockerT m (Either DockerError ())
- unpauseContainer :: forall m. Monad m => ContainerID -> DockerT m (Either DockerError ())
- deleteContainer :: forall m. Monad m => DeleteOpts -> ContainerID -> DockerT m (Either DockerError ())
- inspectContainer :: forall m. Monad m => ContainerID -> DockerT m (Either DockerError ContainerDetails)
- getContainerLogs :: forall m. Monad m => LogOpts -> ContainerID -> DockerT m (Either DockerError ByteString)
- listImages :: forall m. Monad m => ListOpts -> DockerT m (Either DockerError [Image])
- getDockerVersion :: forall m. Monad m => DockerT m (Either DockerError DockerVersion)
Containers
listContainers :: forall m. Monad m => ListOpts -> DockerT m (Either DockerError [Container]) Source #
Lists all running docker containers. Pass in
to get a list of stopped containers as well.defaultListOpts
{all
= True}
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.
inspectContainer :: forall m. Monad m => ContainerID -> DockerT m (Either DockerError ContainerDetails) Source #
Gets ContainerDetails
for a given ContainerID
.
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 LogDriverType
s 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.