public interface DockerClient
| Modifier and Type | Interface and Description |
|---|---|
static class |
DockerClient.ListContainersParam
Parameters for
listContainers(ListContainersParam...) |
static class |
DockerClient.LogsParameter
Parameters for
logs(String, LogsParameter...) |
| Modifier and Type | Method and Description |
|---|---|
ContainerCreation |
createContainer(ContainerConfig config)
Create a docker container.
|
ContainerCreation |
createContainer(ContainerConfig config,
String name)
Create a docker container.
|
ContainerInfo |
inspectContainer(String containerId)
Inspect a docker container.
|
ImageInfo |
inspectImage(String image)
Inspect a docker container image.
|
void |
killContainer(String containerId)
Kill a docker container.
|
List<Container> |
listContainers(DockerClient.ListContainersParam... params)
List docker containers.
|
LogStream |
logs(String containerId,
DockerClient.LogsParameter... params)
Get docker container logs.
|
void |
pull(String image)
Pull a docker container image.
|
void |
removeContainer(String containerId)
Remove a docker container.
|
void |
removeContainer(String containerId,
boolean removeVolumes)
Remove a docker container.
|
List<RemovedImage> |
removeImage(String image)
Remove a docker image.
|
List<RemovedImage> |
removeImage(String image,
boolean force,
boolean noPrune)
Remove a docker image.
|
void |
startContainer(String containerId)
Start a docker container.
|
void |
startContainer(String containerId,
HostConfig hostConfig)
Start a docker container.
|
void |
tag(String image,
String name)
Tag a docker image.
|
Version |
version()
Get the docker version.
|
ContainerExit |
waitContainer(String containerId)
Wait for a docker container to exit.
|
Version version() throws DockerException, InterruptedException
DockerExceptionInterruptedExceptionList<Container> listContainers(DockerClient.ListContainersParam... params) throws DockerException, InterruptedException
params - Container listing and filtering options.DockerExceptionInterruptedExceptionContainerInfo inspectContainer(String containerId) throws DockerException, InterruptedException
containerId - The id of the container to inspect.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionImageInfo inspectImage(String image) throws DockerException, InterruptedException
image - The image to inspect.ImageNotFoundException - if the image was not found (404).DockerExceptionInterruptedExceptionList<RemovedImage> removeImage(String image) throws DockerException, InterruptedException
image - The image to remove.ImageNotFoundException - if the image was not found (404).DockerExceptionInterruptedExceptionList<RemovedImage> removeImage(String image, boolean force, boolean noPrune) throws DockerException, InterruptedException
image - The image to remove.force - Force image removal.noPrune - Do not delete untagged parents.ImageNotFoundException - if the image was not found (404).DockerExceptionInterruptedExceptionvoid pull(String image) throws DockerException, InterruptedException
image - The image to pull.DockerExceptionInterruptedExceptionvoid tag(String image, String name) throws DockerException, InterruptedException
image - The image to tag.name - The new name that will be applied to the image.DockerExceptionInterruptedExceptionContainerCreation createContainer(ContainerConfig config) throws DockerException, InterruptedException
config - The container configuration.ImageNotFoundException - if the image was not found (404).DockerExceptionInterruptedExceptionContainerCreation createContainer(ContainerConfig config, String name) throws DockerException, InterruptedException
config - The container configuration.name - The container name.ImageNotFoundException - if the image was not found (404).DockerExceptionInterruptedExceptionvoid startContainer(String containerId) throws DockerException, InterruptedException
containerId - The id of the container to start.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionvoid startContainer(String containerId, HostConfig hostConfig) throws DockerException, InterruptedException
containerId - The id of the container to start.hostConfig - The docker host configuration to use when starting the container.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionContainerExit waitContainer(String containerId) throws DockerException, InterruptedException
containerId - The id of the container to wait for.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionvoid killContainer(String containerId) throws DockerException, InterruptedException
containerId - The id of the container to kill.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionvoid removeContainer(String containerId) throws DockerException, InterruptedException
containerId - The id of the container to remove.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionvoid removeContainer(String containerId, boolean removeVolumes) throws DockerException, InterruptedException
containerId - The id of the container to remove.removeVolumes - Whether to remove volumes as well.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionLogStream logs(String containerId, DockerClient.LogsParameter... params) throws DockerException, InterruptedException
containerId - The id of the container to get logs for.params - Params for controlling what streams to get and whether to tail or not.ContainerNotFoundException - if the container was not found (404).DockerExceptionInterruptedExceptionCopyright © 2014. All rights reserved.