public class DefaultDockerClient extends Object implements DockerClient, Closeable
Modifier and Type | Class and Description |
---|---|
static class |
DefaultDockerClient.Builder |
DockerClient.AttachParameter, DockerClient.BuildParam, DockerClient.EventsFilterParam, DockerClient.EventsParam, DockerClient.ExecCreateParam, DockerClient.ExecStartParameter, DockerClient.FilterParam, DockerClient.ListContainersFilterParam, DockerClient.ListContainersParam, DockerClient.ListImagesFilterParam, DockerClient.ListImagesParam, DockerClient.ListNetworksFilterParam, DockerClient.ListNetworksParam, DockerClient.ListVolumesFilterParam, DockerClient.ListVolumesParam, DockerClient.LogsParam, DockerClient.Param, DockerClient.RemoveContainerParam, DockerClient.Signal
Modifier | Constructor and Description |
---|---|
protected |
DefaultDockerClient(DefaultDockerClient.Builder builder)
Create a new client using the configuration of the builder.
|
|
DefaultDockerClient(String uri)
Create a new client with default configuration.
|
|
DefaultDockerClient(URI uri)
Create a new client with default configuration.
|
|
DefaultDockerClient(URI uri,
DockerCertificatesStore dockerCertificatesStore)
Create a new client with default configuration.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
archiveContainer(String containerId,
String path)
Copies an archive out of a container.
|
LogStream |
attachContainer(String containerId,
DockerClient.AttachParameter... params)
Attach to the container id.
|
int |
auth(RegistryAuth registryAuth)
Check auth configuration.
|
String |
build(Path directory,
DockerClient.BuildParam... params)
Build a docker image.
|
String |
build(Path directory,
ProgressHandler handler,
DockerClient.BuildParam... params)
Build a docker image.
|
String |
build(Path directory,
String name,
DockerClient.BuildParam... params)
Build a docker image.
|
String |
build(Path directory,
String name,
ProgressHandler handler,
DockerClient.BuildParam... params)
Build a docker image.
|
String |
build(Path directory,
String name,
String dockerfile,
ProgressHandler handler,
DockerClient.BuildParam... params)
Build a docker image.
|
static DefaultDockerClient.Builder |
builder()
Create a new
DefaultDockerClient builder. |
void |
close()
Closes any and all underlying connections to docker, and release resources.
|
ContainerCreation |
commitContainer(String containerId,
String repo,
String tag,
ContainerConfig config,
String comment,
String author)
Create a new image from a container's changes.
|
void |
connectToNetwork(String networkId,
NetworkConnection networkConnection)
Connects a docker container to a network, with extended configuration.
|
void |
connectToNetwork(String containerId,
String networkId)
Connects a docker container to a network.
|
InputStream |
copyContainer(String containerId,
String path)
Deprecated.
|
void |
copyToContainer(InputStream tarStream,
String containerId,
String path) |
void |
copyToContainer(Path directory,
String containerId,
String path)
Copies some files from host to container.
|
void |
create(String image,
InputStream imagePayload)
Creates a single image from a tarball.
|
void |
create(String image,
InputStream imagePayload,
ProgressHandler handler)
Creates a single image from a tarball.
|
ConfigCreateResponse |
createConfig(ConfigSpec config)
Create a config.
|
ContainerCreation |
createContainer(ContainerConfig config)
Create a docker container.
|
ContainerCreation |
createContainer(ContainerConfig config,
String name)
Create a docker container.
|
NetworkCreation |
createNetwork(NetworkConfig networkConfig)
Create a new network.
|
SecretCreateResponse |
createSecret(SecretSpec secret)
Create a secret.
|
ServiceCreateResponse |
createService(ServiceSpec spec)
Create a new service.
|
ServiceCreateResponse |
createService(ServiceSpec spec,
RegistryAuth config)
Create a new service.
|
Volume |
createVolume() |
Volume |
createVolume(Volume volume) |
void |
deleteConfig(String configId)
Delete a config.
|
void |
deleteNode(String nodeId)
Remove a node from the swarm.
|
void |
deleteNode(String nodeId,
boolean force)
Remove a node from the swarm.
|
void |
deleteSecret(String secretId)
Delete a secret.
|
void |
disconnectFromNetwork(String containerId,
String networkId)
Disconnects a docker container to a network.
|
void |
disconnectFromNetwork(String containerId,
String networkId,
boolean force)
Disconnects a docker container to a network.
|
EventStream |
events(DockerClient.EventsParam... params)
Watches the docker API for events.
|
ExecCreation |
execCreate(String containerId,
String[] cmd,
DockerClient.ExecCreateParam... params)
Sets up an exec instance in a running container id.
|
ExecState |
execInspect(String execId)
Inspects a running or previously run exec instance id.
|
void |
execResizeTty(String execId,
Integer height,
Integer width)
Resizes the tty session used by an exec command.
|
LogStream |
execStart(String execId,
DockerClient.ExecStartParameter... params)
Starts a previously set up exec instance id.
|
InputStream |
exportContainer(String containerId)
Export a docker container as a tar archive.
|
static DefaultDockerClient.Builder |
fromEnv()
Create a new
DefaultDockerClient builder prepopulated with values loaded from the
DOCKER_HOST and DOCKER_CERT_PATH environment variables. |
Distribution |
getDistribution(String imageName)
Get the distribution of a container.
|
String |
getHost()
Get the Docker host address.
|
List<ImageHistory> |
history(String image)
Return the history of the image.
|
Info |
info()
Get docker instance information.
|
String |
initSwarm(SwarmInit swarmInit)
Initialize a new swarm.
|
Config |
inspectConfig(String configId)
Inspect a config.
|
ContainerInfo |
inspectContainer(String containerId)
Inspect a docker container.
|
List<ContainerChange> |
inspectContainerChanges(String containerId)
Inspect changes on a container's filesystem.
|
ImageInfo |
inspectImage(String image)
Inspect a docker container image.
|
Network |
inspectNetwork(String networkId)
Inspect a specific network.
|
NodeInfo |
inspectNode(String nodeId)
Inspects a swarm node.
|
Secret |
inspectSecret(String secretId)
Inspect a secret.
|
Service |
inspectService(String serviceId)
Inspect an existing service.
|
Swarm |
inspectSwarm()
Inspect the swarm.
|
Task |
inspectTask(String taskId)
Inspect an existing task.
|
Volume |
inspectVolume(String volumeName) |
void |
joinSwarm(SwarmJoin swarmJoin)
Join an existing swarm.
|
void |
killContainer(String containerId)
Kill a docker container.
|
void |
killContainer(String containerId,
DockerClient.Signal signal)
Kill a docker container.
|
void |
leaveSwarm()
Leave a swarm.
|
void |
leaveSwarm(boolean force)
Leave a swarm forcefully.
|
List<Config> |
listConfigs()
List swarm configs.
|
List<Config> |
listConfigs(Config.Criteria criteria)
List swarm configs.
|
List<Container> |
listContainers(DockerClient.ListContainersParam... params)
List docker containers.
|
List<Image> |
listImages(DockerClient.ListImagesParam... params)
List docker images.
|
List<Network> |
listNetworks(DockerClient.ListNetworksParam... params)
List all or a subset of the networks.
|
List<Node> |
listNodes()
List swarm nodes.
|
List<Node> |
listNodes(Node.Criteria criteria)
List swarm nodes that match the given criteria.
|
List<Secret> |
listSecrets()
List secrets.
|
List<Service> |
listServices()
List all services.
|
List<Service> |
listServices(Service.Criteria criteria)
List services that match the given criteria.
|
List<Task> |
listTasks()
List all tasks.
|
List<Task> |
listTasks(Task.Criteria criteria)
List tasks that match the given criteria.
|
VolumeList |
listVolumes(DockerClient.ListVolumesParam... params) |
Set<String> |
load(InputStream imagePayload)
Load a set of images and tags from a tarball.
|
Set<String> |
load(InputStream imagePayload,
ProgressHandler handler)
Load a set of images and tags from a tarball, using a custom ProgressMessageHandler.
|
void |
load(String image,
InputStream imagePayload)
Deprecated.
|
void |
load(String image,
InputStream imagePayload,
ProgressHandler handler)
Deprecated.
|
LogStream |
logs(String containerId,
DockerClient.LogsParam... params)
Get docker container logs.
|
void |
pauseContainer(String containerId)
Pause a docker container.
|
String |
ping()
Ping the docker daemon.
|
void |
pull(String image)
Pull a docker container image.
|
void |
pull(String image,
ProgressHandler handler)
Pull a docker container image, using a custom ProgressMessageHandler
|
void |
pull(String image,
RegistryAuth registryAuth)
Pull a private docker container image.
|
void |
pull(String image,
RegistryAuth registryAuth,
ProgressHandler handler)
Pull a private docker container image, using a custom ProgressMessageHandler.
|
void |
push(String image)
Push a docker container image.
|
void |
push(String image,
ProgressHandler handler)
Push a docker container image, using a custom ProgressHandler
|
void |
push(String image,
ProgressHandler handler,
RegistryAuth registryAuth) |
void |
push(String image,
RegistryAuth registryAuth) |
void |
removeContainer(String containerId)
Remove a docker container.
|
void |
removeContainer(String containerId,
boolean removeVolumes)
Deprecated.
|
void |
removeContainer(String containerId,
DockerClient.RemoveContainerParam... params)
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 |
removeNetwork(String networkId)
Remove a docker network.
|
void |
removeService(String serviceId)
Remove an existing service.
|
void |
removeVolume(String volumeName) |
void |
removeVolume(Volume volume) |
void |
renameContainer(String containerId,
String name)
Rename a docker container.
|
void |
resizeTty(String containerId,
Integer height,
Integer width)
Resize container TTY
This API is valid only if
tty was specified as
part of creating the container. |
void |
restartContainer(String containerId)
Restart a docker container.
|
void |
restartContainer(String containerId,
int secondsToWaitBeforeRestart)
Restart a docker container.
|
InputStream |
save(String... images)
Get a tarball containing all images and metadata for the repository specified.
|
InputStream |
saveMultiple(String... images)
Get a tarball containing all images and metadata for one or more repositories.
|
List<ImageSearchResult> |
searchImages(String term)
Search for images on Docker Hub
|
LogStream |
serviceLogs(String serviceId,
DockerClient.LogsParam... params)
Get docker service logs.
|
void |
startContainer(String containerId)
Start a docker container.
|
ContainerStats |
stats(String containerId)
Retrieves one-time stats (stream=0) for the container with the specified id.
|
void |
stopContainer(String containerId,
int secondsToWaitBeforeKilling)
Stop a docker container by sending a SIGTERM, and following up with a SIGKILL if the container
doesn't exit gracefully and in a timely manner.
|
void |
tag(String image,
String name)
Tag a docker image.
|
void |
tag(String image,
String name,
boolean force)
Tag a docker image.
|
TopResults |
topContainer(String containerId)
List processes running inside the container by using
ps . |
TopResults |
topContainer(String containerId,
String psArgs)
List processes running inside the container using
ps and the given arguments. |
void |
unlock(UnlockKey unlockKey)
Unlock a swarm.
|
UnlockKey |
unlockKey()
Get an unlock key for unlocking a swarm.
|
void |
unpauseContainer(String containerId)
Unpause a docker container.
|
void |
updateConfig(String configId,
Long version,
ConfigSpec nodeSpec)
Update a swarm config.
|
ContainerUpdate |
updateContainer(String containerId,
HostConfig config)
Update an existing container.
|
void |
updateNode(String nodeId,
Long version,
NodeSpec nodeSpec)
Update a swarm node.
|
void |
updateService(String serviceId,
Long version,
ServiceSpec spec)
Update an existing service.
|
void |
updateService(String serviceId,
Long version,
ServiceSpec spec,
RegistryAuth config)
Update an existing service.
|
void |
updateSwarm(Long version,
boolean rotateWorkerToken,
boolean rotateManagerToken,
boolean rotateManagerUnlockKey,
SwarmSpec spec)
Update a swarm.
|
void |
updateSwarm(Long version,
boolean rotateWorkerToken,
boolean rotateManagerToken,
SwarmSpec spec)
Update a swarm.
|
void |
updateSwarm(Long version,
boolean rotateWorkerToken,
SwarmSpec spec)
Update a swarm.
|
void |
updateSwarm(Long version,
SwarmSpec spec)
Update a swarm.
|
Version |
version()
Get the docker version.
|
ContainerExit |
waitContainer(String containerId)
Wait for a docker container to exit.
|
public DefaultDockerClient(String uri)
uri
- The docker rest api uri.public DefaultDockerClient(URI uri)
uri
- The docker rest api uri.public DefaultDockerClient(URI uri, DockerCertificatesStore dockerCertificatesStore)
uri
- The docker rest api uri.dockerCertificatesStore
- The certificates to use for HTTPS.protected DefaultDockerClient(DefaultDockerClient.Builder builder)
builder
- DefaultDockerClient builderpublic String getHost()
DockerClient
getHost
in interface DockerClient
public void close()
DockerClient
close
in interface DockerClient
close
in interface Closeable
close
in interface AutoCloseable
public String ping() throws DockerException, InterruptedException
DockerClient
ping
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Version version() throws DockerException, InterruptedException
DockerClient
version
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic int auth(RegistryAuth registryAuth) throws DockerException, InterruptedException
DockerClient
auth
in interface DockerClient
registryAuth
- The RegistryAuth
needed to pull the image.DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Info info() throws DockerException, InterruptedException
DockerClient
info
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Container> listContainers(DockerClient.ListContainersParam... params) throws DockerException, InterruptedException
DockerClient
listContainers
in interface DockerClient
params
- Container listing and filtering options.BadParamException
- if one or more params were bad (400)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Image> listImages(DockerClient.ListImagesParam... params) throws DockerException, InterruptedException
DockerClient
listImages
in interface DockerClient
params
- Image listing and filtering options.BadParamException
- if one or more params were bad (400)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ContainerCreation createContainer(ContainerConfig config) throws DockerException, InterruptedException
DockerClient
createContainer
in interface DockerClient
config
- The container configuration.ImageNotFoundException
- if the requested parent image was not found (404)DockerException
- if logs cannot be attached, because container is not running (406),
or if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ContainerCreation createContainer(ContainerConfig config, String name) throws DockerException, InterruptedException
DockerClient
createContainer
in interface DockerClient
config
- The container configuration.name
- The container name.ImageNotFoundException
- if the requested parent image was not found (404)DockerException
- if logs cannot be attached, because container is not running (406),
or if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void startContainer(String containerId) throws DockerException, InterruptedException
DockerClient
startContainer
in interface DockerClient
containerId
- The id of the container to start.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void pauseContainer(String containerId) throws DockerException, InterruptedException
DockerClient
pauseContainer
in interface DockerClient
containerId
- The id of the container to pause.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void unpauseContainer(String containerId) throws DockerException, InterruptedException
DockerClient
unpauseContainer
in interface DockerClient
containerId
- The id of the container to pause.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void restartContainer(String containerId) throws DockerException, InterruptedException
DockerClient
restartContainer
in interface DockerClient
containerId
- The id of the container to restart.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void restartContainer(String containerId, int secondsToWaitBeforeRestart) throws DockerException, InterruptedException
DockerClient
restartContainer
in interface DockerClient
containerId
- The id of the container to restart.secondsToWaitBeforeRestart
- number of seconds to wait before killing the container.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void killContainer(String containerId) throws DockerException, InterruptedException
DockerClient
killContainer
in interface DockerClient
containerId
- The id of the container to kill.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void killContainer(String containerId, DockerClient.Signal signal) throws DockerException, InterruptedException
DockerClient
killContainer
in interface DockerClient
containerId
- The id of the container to kill.signal
- Signal used to kill the process.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Distribution getDistribution(String imageName) throws DockerException, InterruptedException
DockerClient
getDistribution
in interface DockerClient
imageName
- The name of the container.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void stopContainer(String containerId, int secondsToWaitBeforeKilling) throws DockerException, InterruptedException
DockerClient
stopContainer
in interface DockerClient
containerId
- The id of the container to stop.secondsToWaitBeforeKilling
- Time to wait after SIGTERM before sending SIGKILL.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ContainerExit waitContainer(String containerId) throws DockerException, InterruptedException
DockerClient
waitContainer
in interface DockerClient
containerId
- The id of the container to wait for.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void removeContainer(String containerId) throws DockerException, InterruptedException
DockerClient
removeContainer
in interface DockerClient
containerId
- The id of the container to remove.BadParamException
- if one or more params were bad (400)ContainerNotFoundException
- if container is not found (404)DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interrupted@Deprecated public void removeContainer(String containerId, boolean removeVolumes) throws DockerException, InterruptedException
DockerClient
removeContainer
in interface DockerClient
containerId
- The id of the container to remove.removeVolumes
- Whether to remove volumes as well.BadParamException
- if one or more params were bad (400)ContainerNotFoundException
- if container is not found (404)DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void removeContainer(String containerId, DockerClient.RemoveContainerParam... params) throws DockerException, InterruptedException
DockerClient
removeContainer
in interface DockerClient
containerId
- The id of the container to remove.params
- DockerClient.RemoveContainerParam
BadParamException
- if one or more params were bad (400)ContainerNotFoundException
- if container is not found (404)DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic InputStream exportContainer(String containerId) throws DockerException, InterruptedException
DockerClient
exportContainer
in interface DockerClient
containerId
- The id of the container to export.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interrupted@Deprecated public InputStream copyContainer(String containerId, String path) throws DockerException, InterruptedException
DockerClient
copyContainer
in interface DockerClient
containerId
- The id of the container to copy files from.path
- The path inside of the container to copy. If this is a directory, it will
be copied recursively. If this is a file, only that file will be copied.copy(..., "/usr/share")
will result in a directory called share
in the tar archive). The directory
name is completely resolved, so copying "/usr/share/././."
will still create
a directory called "share"
in the tar archive. If a single file was copied,
that file will be the sole entry in the tar archive. Copying "."
or
equivalently "/"
will result in the tar archive containing a single folder
named after the container ID.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)UnsupportedApiVersionException
- If client API is greater than or equal to 1.24InterruptedException
- If the thread is interruptedpublic InputStream archiveContainer(String containerId, String path) throws DockerException, InterruptedException
DockerClient
archiveContainer
in interface DockerClient
containerId
- The id of the container to copy files from.path
- The path inside of the container to copy. If this is a directory, it will
be copied recursively. If this is a file, only that file will be copied.copy(..., "/usr/share")
will result in a directory called share
in the tar archive). The directory name
is completely resolved, so copying "/usr/share/././."
will still create a
directory called "share"
in the tar archive. If a single file was copied,
that file will be the sole entry in the tar archive. Copying "."
or
equivalently "/"
will result in the tar archive containing a single folder
named after the container ID.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic TopResults topContainer(String containerId) throws DockerException, InterruptedException
DockerClient
ps
.topContainer
in interface DockerClient
containerId
- the id of the container to examineDockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.public TopResults topContainer(String containerId, String psArgs) throws DockerException, InterruptedException
DockerClient
ps
and the given arguments.topContainer
in interface DockerClient
containerId
- the id of the container to examinepsArgs
- the arguments to pass to ps
inside the container, e.g., "-ef"
DockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.public void copyToContainer(Path directory, String containerId, String path) throws DockerException, InterruptedException, IOException
DockerClient
copyToContainer
in interface DockerClient
directory
- The path to sent to containercontainerId
- The id of the container to sent files.path
- The path inside of the container to put files.BadParamException
- if one or more params were bad (400)PermissionException
- if the volume or container root file system is marked "read only"ContainerNotFoundException
- if container is not found (404)DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedIOException
- If IOExceptionpublic void copyToContainer(InputStream tarStream, String containerId, String path) throws DockerException, InterruptedException
copyToContainer
in interface DockerClient
DockerException
InterruptedException
public List<ContainerChange> inspectContainerChanges(String containerId) throws DockerException, InterruptedException
DockerClient
inspectContainerChanges
in interface DockerClient
containerId
- The id of the container.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ContainerInfo inspectContainer(String containerId) throws DockerException, InterruptedException
DockerClient
inspectContainer
in interface DockerClient
containerId
- The id of the container to inspect.ContainerNotFoundException
- if container was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ContainerCreation commitContainer(String containerId, String repo, String tag, ContainerConfig config, String comment, String author) throws DockerException, InterruptedException
DockerClient
commitContainer
in interface DockerClient
containerId
- The id of the container to commit.repo
- repository to commit to.tag
- image tag.config
- ContainerConfig to commit.comment
- commit message.author
- image author.ContainerNotFoundException
- if container was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void renameContainer(String containerId, String name) throws DockerException, InterruptedException
DockerClient
renameContainer
in interface DockerClient
containerId
- The id of the container to rename.name
- The new name the container will haveContainerNotFoundException
- if container cannot be found (404)ContainerRenameConflictException
- if name is already assigned (409)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ContainerUpdate updateContainer(String containerId, HostConfig config) throws DockerException, InterruptedException
DockerClient
updateContainer
in interface DockerClient
containerId
- the identifier of the containerconfig
- the new container host configDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<ImageSearchResult> searchImages(String term) throws DockerException, InterruptedException
DockerClient
This method is broken for Docker 1.7.x because of a Docker bug. See https://github.com/docker/docker/pull/14850.
searchImages
in interface DockerClient
term
- the search termDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interrupted@Deprecated public void load(String image, InputStream imagePayload) throws DockerException, InterruptedException
DockerClient
load
in interface DockerClient
image
- the name to assign to the image.imagePayload
- the image's payload (i.e.: the stream corresponding to the image's .tar
file).DockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.@Deprecated public void load(String image, InputStream imagePayload, ProgressHandler handler) throws DockerException, InterruptedException
DockerClient
load
in interface DockerClient
image
- the name to assign to the image.imagePayload
- the image's payload (i.e.: the stream corresponding to the image's .tar
file).handler
- The handler to use for processing each progress message received from
Docker.DockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.public Set<String> load(InputStream imagePayload) throws DockerException, InterruptedException
DockerClient
load
in interface DockerClient
imagePayload
- the image's payload (i.e.: the stream corresponding to the image's .tar
file).DockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.public Set<String> load(InputStream imagePayload, ProgressHandler handler) throws DockerException, InterruptedException
DockerClient
load
in interface DockerClient
imagePayload
- the image's payload (i.e.: the stream corresponding to the image's .tar
file).handler
- The handler to use for processing each progress message received from
Docker.DockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.public void create(String image, InputStream imagePayload) throws DockerException, InterruptedException
DockerClient
create
in interface DockerClient
image
- the name to assign to the image.imagePayload
- the image's payload (i.e.: the stream corresponding to the image's .tar
file).DockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.public void create(String image, InputStream imagePayload, ProgressHandler handler) throws DockerException, InterruptedException
DockerClient
create
in interface DockerClient
image
- the name to assign to the image.imagePayload
- the image's payload (i.e.: the stream corresponding to the image's .tar
file).handler
- The handler to use for processing each progress message received from
Docker.DockerException
- if a server error occurred (500).InterruptedException
- if the thread is interrupted.public InputStream save(String... images) throws DockerException, IOException, InterruptedException
DockerClient
save
in interface DockerClient
images
- the name(s) of one or more images to save. If a specific name and tag
(e.g. ubuntu:latest), then only that image (and its parents) are returned.
If an image ID, similarly only that image (and its parents) are returned,
but with the exclusion of the 'repositories' file in the tarball,
as there were no image names referenced.DockerException
- if a server error occurred (500).IOException
- if the server started returning, but an I/O error occurred in the
context of processing it on the client-side.InterruptedException
- if the thread is interrupted.public InputStream saveMultiple(String... images) throws DockerException, IOException, InterruptedException
DockerClient
saveMultiple
in interface DockerClient
images
- the name or id of the image to save.
if it is a specific name and tag (e.g. ubuntu:latest), then only that image
(and its parents) are returned; if it is an image ID, similarly only that
image (and its parents) are returned and there would be no names referenced
in the 'repositories' file for this image ID.DockerException
- if a server error occurred (500).IOException
- if the server started returning, but an I/O error occurred in the
context of processing it on the client-side.InterruptedException
- if the thread is interrupted.public void pull(String image) throws DockerException, InterruptedException
DockerClient
pull
in interface DockerClient
image
- The image to pull.ImageNotFoundException
- if image was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void pull(String image, ProgressHandler handler) throws DockerException, InterruptedException
DockerClient
pull
in interface DockerClient
image
- The image to pull.handler
- The handler to use for processing each progress message received from Docker.ImageNotFoundException
- if image was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void pull(String image, RegistryAuth registryAuth) throws DockerException, InterruptedException
DockerClient
pull
in interface DockerClient
image
- The image to pull.registryAuth
- The RegistryAuth
needed to pull the image.ImageNotFoundException
- if image was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void pull(String image, RegistryAuth registryAuth, ProgressHandler handler) throws DockerException, InterruptedException
DockerClient
pull
in interface DockerClient
image
- The image to pull.registryAuth
- The RegistryAuth
needed to pull the image.handler
- The handler to use for processing each progress message received from
Docker.ImageNotFoundException
- if image was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void push(String image) throws DockerException, InterruptedException
DockerClient
push
in interface DockerClient
image
- The image to push.ImageNotFoundException
- if image was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void push(String image, RegistryAuth registryAuth) throws DockerException, InterruptedException
push
in interface DockerClient
DockerException
InterruptedException
public void push(String image, ProgressHandler handler) throws DockerException, InterruptedException
DockerClient
push
in interface DockerClient
image
- The image to push.handler
- The handler to use for processing each progress message received from Docker.ImageNotFoundException
- if image was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void push(String image, ProgressHandler handler, RegistryAuth registryAuth) throws DockerException, InterruptedException
push
in interface DockerClient
DockerException
InterruptedException
public void tag(String image, String name) throws DockerException, InterruptedException
DockerClient
tag
in interface DockerClient
image
- The image to tag.name
- The new name that will be applied to the image.BadParamException
- if one or more params were bad (400)ImageNotFoundException
- if image was not found (404)ConflictException
- conflict (409)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void tag(String image, String name, boolean force) throws DockerException, InterruptedException
DockerClient
tag
in interface DockerClient
image
- The image to tag.name
- The new name that will be applied to the image.force
- Whether to force the tagging even if the tag is already assigned to another
image.BadParamException
- if one or more params were bad (400)ImageNotFoundException
- if image was not found (404)ConflictException
- conflict (409)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic String build(Path directory, DockerClient.BuildParam... params) throws DockerException, InterruptedException, IOException
DockerClient
build
in interface DockerClient
directory
- The directory containing the dockerfile.params
- Additional flags to use during build.DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedIOException
- If some IO shit happened.public String build(Path directory, String name, DockerClient.BuildParam... params) throws DockerException, InterruptedException, IOException
DockerClient
build
in interface DockerClient
directory
- The directory containing the dockerfile.name
- The repository name and optional tag to apply to the built image.params
- Additional flags to use during build.DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedIOException
- If some IO shit happened.public String build(Path directory, ProgressHandler handler, DockerClient.BuildParam... params) throws DockerException, InterruptedException, IOException
DockerClient
build
in interface DockerClient
directory
- The directory containing the dockerfile.handler
- The handler to use for processing each progress message received from Docker.params
- Additional flags to use during build.DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedIOException
- If some IO shit happened.public String build(Path directory, String name, ProgressHandler handler, DockerClient.BuildParam... params) throws DockerException, InterruptedException, IOException
DockerClient
build
in interface DockerClient
directory
- The directory containing the dockerfile.name
- The repository name and optional tag to apply to the built image.handler
- The handler to use for processing each progress message received from Docker.params
- Additional flags to use during build.DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedIOException
- If some IO shit happened.public String build(Path directory, String name, String dockerfile, ProgressHandler handler, DockerClient.BuildParam... params) throws DockerException, InterruptedException, IOException
DockerClient
build
in interface DockerClient
directory
- The directory containing the dockerfile.name
- The repository name and optional tag to apply to the built image.dockerfile
- The path within the build context to the Dockerfilehandler
- The handler to use for processing each progress message received from
Docker.params
- Additional flags to use during build.DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedIOException
- If some IO shit happened.public ImageInfo inspectImage(String image) throws DockerException, InterruptedException
DockerClient
inspectImage
in interface DockerClient
image
- The image to inspect.ImageNotFoundException
- if image was not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<RemovedImage> removeImage(String image) throws DockerException, InterruptedException
DockerClient
removeImage
in interface DockerClient
image
- The image to remove.ImageNotFoundException
- if image was not found (404)ConflictException
- conflict (409)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<RemovedImage> removeImage(String image, boolean force, boolean noPrune) throws DockerException, InterruptedException
DockerClient
removeImage
in interface DockerClient
image
- The image to remove.force
- Force image removal.noPrune
- Do not delete untagged parents.ImageNotFoundException
- if image was not found (404)ConflictException
- conflict (409)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<ImageHistory> history(String image) throws DockerException, InterruptedException
DockerClient
history
in interface DockerClient
image
- An image name or ID.ImageHistory
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic LogStream logs(String containerId, DockerClient.LogsParam... params) throws DockerException, InterruptedException
DockerClient
logs
in interface DockerClient
containerId
- The id of the container to get logs for.params
- Params for controlling what streams to get and whether to tail or not.BadParamException
- if one or more params were bad (400)ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic EventStream events(DockerClient.EventsParam... params) throws DockerException, InterruptedException
DockerClient
This method is broken for Docker 1.7.x because of a Docker bug. See https://github.com/docker/docker/issues/14354.
events
in interface DockerClient
params
- The parameters to apply to the events requestDockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic LogStream attachContainer(String containerId, DockerClient.AttachParameter... params) throws DockerException, InterruptedException
DockerClient
attachContainer
in interface DockerClient
containerId
- The id of the container to get logs for.params
- Params for controlling what streams to get and whether to tail or not.BadParamException
- if one or more params were bad (400)ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ExecCreation execCreate(String containerId, String[] cmd, DockerClient.ExecCreateParam... params) throws DockerException, InterruptedException
DockerClient
execCreate
in interface DockerClient
containerId
- The id of the containercmd
- shell commandparams
- Exec paramsExecCreation
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic LogStream execStart(String execId, DockerClient.ExecStartParameter... params) throws DockerException, InterruptedException
DockerClient
execStart
in interface DockerClient
execId
- exec idparams
- Exec start paramsExecNotFoundException
- if exec instance is not found (404)ExecStartConflictException
- if container is paused (409)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Swarm inspectSwarm() throws DockerException, InterruptedException
DockerClient
inspectSwarm
in interface DockerClient
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic String initSwarm(SwarmInit swarmInit) throws DockerException, InterruptedException
DockerClient
initSwarm
in interface DockerClient
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void joinSwarm(SwarmJoin swarmJoin) throws DockerException, InterruptedException
DockerClient
joinSwarm
in interface DockerClient
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void leaveSwarm() throws DockerException, InterruptedException
DockerClient
leaveSwarm
in interface DockerClient
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void leaveSwarm(boolean force) throws DockerException, InterruptedException
DockerClient
leaveSwarm
in interface DockerClient
force
- Whether to leave forcefullyDockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void updateSwarm(Long version, boolean rotateWorkerToken, boolean rotateManagerToken, boolean rotateManagerUnlockKey, SwarmSpec spec) throws DockerException, InterruptedException
DockerClient
updateSwarm
in interface DockerClient
version
- The version number of the swarm object being updated.
This is required to avoid conflicting writes.rotateWorkerToken
- Set to true to rotate the worker join token.rotateManagerToken
- Set to true to rotate the worker join token.rotateManagerUnlockKey
- Set to true to rotate the manager unlock key.spec
- SwarmSpec
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void updateSwarm(Long version, boolean rotateWorkerToken, boolean rotateManagerToken, SwarmSpec spec) throws DockerException, InterruptedException
DockerClient
updateSwarm
in interface DockerClient
version
- The version number of the swarm object being updated.
This is required to avoid conflicting writes.rotateWorkerToken
- Set to true to rotate the worker join token.rotateManagerToken
- Set to true to rotate the worker join token.spec
- SwarmSpec
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void updateSwarm(Long version, boolean rotateWorkerToken, SwarmSpec spec) throws DockerException, InterruptedException
DockerClient
updateSwarm
in interface DockerClient
version
- The version number of the swarm object being updated.
This is required to avoid conflicting writes.rotateWorkerToken
- Set to true to rotate the worker join token.spec
- SwarmSpec
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void updateSwarm(Long version, SwarmSpec spec) throws DockerException, InterruptedException
DockerClient
updateSwarm
in interface DockerClient
version
- The version number of the swarm object being updated.
This is required to avoid conflicting writes.spec
- SwarmSpec
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic UnlockKey unlockKey() throws DockerException, InterruptedException
DockerClient
unlockKey
in interface DockerClient
UnlockKey
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void unlock(UnlockKey unlockKey) throws DockerException, InterruptedException
DockerClient
unlock
in interface DockerClient
unlockKey
- UnlockKey
DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ServiceCreateResponse createService(ServiceSpec spec) throws DockerException, InterruptedException
DockerClient
createService
in interface DockerClient
spec
- the service specDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ServiceCreateResponse createService(ServiceSpec spec, RegistryAuth config) throws DockerException, InterruptedException
DockerClient
createService
in interface DockerClient
spec
- the service specconfig
- the registry authentication configurationDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Service inspectService(String serviceId) throws DockerException, InterruptedException
DockerClient
inspectService
in interface DockerClient
serviceId
- the id of the service to inspectDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void updateService(String serviceId, Long version, ServiceSpec spec) throws DockerException, InterruptedException
DockerClient
updateService
in interface DockerClient
serviceId
- the identifier of the serviceversion
- the version of the servicespec
- the new service specDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void updateService(String serviceId, Long version, ServiceSpec spec, RegistryAuth config) throws DockerException, InterruptedException
DockerClient
updateService
in interface DockerClient
serviceId
- the identifier of the serviceversion
- the version of the servicespec
- the new service specconfig
- the registry authentication configurationDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Service> listServices() throws DockerException, InterruptedException
DockerClient
listServices
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Service> listServices(Service.Criteria criteria) throws DockerException, InterruptedException
DockerClient
listServices
in interface DockerClient
criteria
- Service listing and filtering options.Service
sDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void removeService(String serviceId) throws DockerException, InterruptedException
DockerClient
removeService
in interface DockerClient
serviceId
- the id of the service to removeDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic LogStream serviceLogs(String serviceId, DockerClient.LogsParam... params) throws DockerException, InterruptedException
DockerClient
serviceLogs
in interface DockerClient
serviceId
- The id of the service to get logs for.params
- Params for controlling what streams to get and whether to tail or not.BadParamException
- if one or more params were bad (400)ServiceNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Task inspectTask(String taskId) throws DockerException, InterruptedException
DockerClient
inspectTask
in interface DockerClient
taskId
- the id of the task to inspectDockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Task> listTasks() throws DockerException, InterruptedException
DockerClient
listTasks
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Task> listTasks(Task.Criteria criteria) throws DockerException, InterruptedException
DockerClient
listTasks
in interface DockerClient
criteria
- Task.Criteria
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Config> listConfigs() throws DockerException, InterruptedException
DockerClient
listConfigs
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- if the thread is interruptedpublic List<Config> listConfigs(Config.Criteria criteria) throws DockerException, InterruptedException
DockerClient
listConfigs
in interface DockerClient
criteria
- Config listing and filtering optionsDockerException
- if a server error occurred (500)InterruptedException
- if the thread is interruptedpublic ConfigCreateResponse createConfig(ConfigSpec config) throws DockerException, InterruptedException
DockerClient
createConfig
in interface DockerClient
config
- The spec for the config.ConfigCreateResponse
ConflictException
- conflict (409)DockerException
- if node is not part of a swarm (503) or a server error occurred (500)InterruptedException
public Config inspectConfig(String configId) throws DockerException, InterruptedException
DockerClient
inspectConfig
in interface DockerClient
configId
- The id of the config.Config
NotFoundException
- config not found (404)DockerException
- if node is not part of a swarm (503) or a server error occurred (500)InterruptedException
public void deleteConfig(String configId) throws DockerException, InterruptedException
DockerClient
deleteConfig
in interface DockerClient
configId
- The id of the config.NotFoundException
- config not found (404)DockerException
- if node is not part of a swarm (503) or a server error occurred (500)InterruptedException
public void updateConfig(String configId, Long version, ConfigSpec nodeSpec) throws DockerException, InterruptedException
DockerClient
updateConfig
in interface DockerClient
configId
- The id of the config to updateversion
- The version number of the config object being updated.
This is required to avoid conflicting writesNodeNotFoundException
- If the config doesn't exist (404)NonSwarmNodeException
- If the config is not part of a swarm (503)DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Node> listNodes() throws DockerException, InterruptedException
DockerClient
listNodes
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Node> listNodes(Node.Criteria criteria) throws DockerException, InterruptedException
DockerClient
listNodes
in interface DockerClient
criteria
- Node listing and filtering options.DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic NodeInfo inspectNode(String nodeId) throws DockerException, InterruptedException
DockerClient
inspectNode
in interface DockerClient
nodeId
- The id of the swarm node to inspectNonSwarmNodeException
- if the node is not part of a swarm (503)DockerException
- if a server error occurred (500)InterruptedException
- if the thread is interruptedpublic void updateNode(String nodeId, Long version, NodeSpec nodeSpec) throws DockerException, InterruptedException
DockerClient
updateNode
in interface DockerClient
nodeId
- The id of the node to updateversion
- The version number of the node object being updated.
This is required to avoid conflicting writesNodeNotFoundException
- If the node doesn't exist (404)NonSwarmNodeException
- If the node is not part of a swarm (503)DockerException
- If a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void deleteNode(String nodeId) throws DockerException, InterruptedException
DockerClient
deleteNode
in interface DockerClient
nodeId
- The id of the node to remove.DockerException
InterruptedException
public void deleteNode(String nodeId, boolean force) throws DockerException, InterruptedException
DockerClient
deleteNode
in interface DockerClient
nodeId
- The id of the node to remove.force
- Forcefully remove the node.DockerException
InterruptedException
public void execResizeTty(String execId, Integer height, Integer width) throws DockerException, InterruptedException
DockerClient
tty
was specified as part
of creating
and
starting
the exec command.execResizeTty
in interface DockerClient
execId
- exec idheight
- height of tty sessionwidth
- width of tty sessionBadParamException
- if both height and width are null or zeroExecNotFoundException
- if exec instance is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ExecState execInspect(String execId) throws DockerException, InterruptedException
DockerClient
execInspect
in interface DockerClient
execId
- exec idExecNotFoundException
- if exec instance is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic ContainerStats stats(String containerId) throws DockerException, InterruptedException
DockerClient
stats
in interface DockerClient
containerId
- The id of the container to retrieve stats for.ContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void resizeTty(String containerId, Integer height, Integer width) throws DockerException, InterruptedException
DockerClient
tty
was specified as
part of creating
the container.resizeTty
in interface DockerClient
containerId
- The id of the container whose TTY will be resized.height
- New height of TTYwidth
- New width of TTYBadParamException
- if both height and width are null or zeroContainerNotFoundException
- if container is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic List<Network> listNetworks(DockerClient.ListNetworksParam... params) throws DockerException, InterruptedException
DockerClient
listNetworks
in interface DockerClient
DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Network inspectNetwork(String networkId) throws DockerException, InterruptedException
DockerClient
inspectNetwork
in interface DockerClient
networkId
- The id of the networkNetworkNotFoundException
- if network is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic NetworkCreation createNetwork(NetworkConfig networkConfig) throws DockerException, InterruptedException
DockerClient
createNetwork
in interface DockerClient
networkConfig
- The network creation parametersNetworkNotFoundException
- if network is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void removeNetwork(String networkId) throws DockerException, InterruptedException
DockerClient
removeNetwork
in interface DockerClient
networkId
- The id of the network to remove.NetworkNotFoundException
- if network is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void connectToNetwork(String containerId, String networkId) throws DockerException, InterruptedException
DockerClient
connectToNetwork
in interface DockerClient
containerId
- The id of the container to connect.networkId
- The id of the network to connect.NotFoundException
- if either container or network is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void connectToNetwork(String networkId, NetworkConnection networkConnection) throws DockerException, InterruptedException
DockerClient
connectToNetwork
in interface DockerClient
networkId
- The id of the network to connect.networkConnection
- The target connection parameters.NotFoundException
- if either container or network is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- if the thread is interruptedpublic void disconnectFromNetwork(String containerId, String networkId) throws DockerException, InterruptedException
DockerClient
disconnectFromNetwork
in interface DockerClient
containerId
- The id of the container to disconnect.networkId
- The id of the network to disconnect.NotFoundException
- if either container or network is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic void disconnectFromNetwork(String containerId, String networkId, boolean force) throws DockerException, InterruptedException
DockerClient
disconnectFromNetwork
in interface DockerClient
containerId
- The id of the container to disconnect.networkId
- The id of the network to disconnect.force
- Force the container to disconnect from the network.NotFoundException
- if either container or network is not found (404)DockerException
- if a server error occurred (500)InterruptedException
- If the thread is interruptedpublic Volume createVolume() throws DockerException, InterruptedException
createVolume
in interface DockerClient
DockerException
InterruptedException
public Volume createVolume(Volume volume) throws DockerException, InterruptedException
createVolume
in interface DockerClient
DockerException
InterruptedException
public Volume inspectVolume(String volumeName) throws DockerException, InterruptedException
inspectVolume
in interface DockerClient
DockerException
InterruptedException
public void removeVolume(Volume volume) throws DockerException, InterruptedException
removeVolume
in interface DockerClient
DockerException
InterruptedException
public void removeVolume(String volumeName) throws DockerException, InterruptedException
removeVolume
in interface DockerClient
DockerException
InterruptedException
public VolumeList listVolumes(DockerClient.ListVolumesParam... params) throws DockerException, InterruptedException
listVolumes
in interface DockerClient
DockerException
InterruptedException
public List<Secret> listSecrets() throws DockerException, InterruptedException
DockerClient
listSecrets
in interface DockerClient
Secret
sDockerException
- if a server error occurred (500)InterruptedException
public SecretCreateResponse createSecret(SecretSpec secret) throws DockerException, InterruptedException
DockerClient
createSecret
in interface DockerClient
secret
- The spec for the secret.SecretCreateResponse
ConflictException
- conflict (409)DockerException
- if node is not part of a swarm (406) or a server error occurred (500)InterruptedException
public Secret inspectSecret(String secretId) throws DockerException, InterruptedException
DockerClient
inspectSecret
in interface DockerClient
secretId
- The id of the secret.Secret
NotFoundException
- secret not found (404)DockerException
- if node is not part of a swarm (406) or a server error occurred (500)InterruptedException
public void deleteSecret(String secretId) throws DockerException, InterruptedException
DockerClient
deleteSecret
in interface DockerClient
secretId
- The id of the secret.NotFoundException
- not found (404)DockerException
- if a server error occurred (500)InterruptedException
public static DefaultDockerClient.Builder builder()
DefaultDockerClient
builder.public static DefaultDockerClient.Builder fromEnv() throws DockerCertificateException
DefaultDockerClient
builder prepopulated with values loaded from the
DOCKER_HOST and DOCKER_CERT_PATH environment variables.DockerCertificateException
- if we could not build a DockerCertificates objectCopyright © 2018. All rights reserved.