private static class DefaultDockerClient.LoadProgressHandler extends Object implements ProgressHandler
ProgressHandler is meant to capture the image ID (or image digest in Docker
1.10+) of an image being loaded.
Weirdly enough, Docker returns the ID or digest of a newly created image in the status of a
progress message. The image ID/digest is required to tag the just loaded image since,
also weirdly enough, the pull operation with the fromSrc parameter does not
support the tag parameter. By retrieving the ID/digest, the image can be tagged
with its image name, given its ID/digest.
| Modifier and Type | Field and Description |
|---|---|
private ProgressHandler |
delegate |
private static int |
EXPECTED_CHARACTER_NUM1 |
private static int |
EXPECTED_CHARACTER_NUM2 |
private String |
imageId |
| Modifier | Constructor and Description |
|---|---|
private |
LoadProgressHandler(ProgressHandler delegate) |
| Modifier and Type | Method and Description |
|---|---|
private String |
getImageId() |
void |
progress(ProgressMessage message)
This method will be called for each progress message received from Docker.
|
private static final int EXPECTED_CHARACTER_NUM1
private static final int EXPECTED_CHARACTER_NUM2
private final ProgressHandler delegate
private String imageId
private LoadProgressHandler(ProgressHandler delegate)
private String getImageId()
public void progress(ProgressMessage message) throws DockerException
ProgressHandlerprogress in interface ProgressHandlermessage - the message to processDockerException - if a server error occurred (500)Copyright © 2016. All rights reserved.