Package com.spotify.docker.client
Class DefaultDockerClient.CreateProgressHandler
- java.lang.Object
-
- com.spotify.docker.client.DefaultDockerClient.CreateProgressHandler
-
- All Implemented Interfaces:
ProgressHandler
- Enclosing class:
- DefaultDockerClient
private static class DefaultDockerClient.CreateProgressHandler extends java.lang.Object implements ProgressHandler
Hack: thisProgressHandleris meant to capture the image ID (or image digest in Docker 1.10+) of an image being created. 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
fromSrcparameter does not support thetagparameter. By retrieving the ID/digest, the image can be tagged with its image name, given its ID/digest.
-
-
Field Summary
Fields Modifier and Type Field Description private ProgressHandlerdelegateprivate static intEXPECTED_CHARACTER_NUM1private static intEXPECTED_CHARACTER_NUM2private java.lang.StringimageId
-
Constructor Summary
Constructors Modifier Constructor Description privateCreateProgressHandler(ProgressHandler delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetImageId()voidprogress(ProgressMessage message)This method will be called for each progress message received from Docker.
-
-
-
Field Detail
-
EXPECTED_CHARACTER_NUM1
private static final int EXPECTED_CHARACTER_NUM1
- See Also:
- Constant Field Values
-
EXPECTED_CHARACTER_NUM2
private static final int EXPECTED_CHARACTER_NUM2
- See Also:
- Constant Field Values
-
delegate
private final ProgressHandler delegate
-
imageId
private java.lang.String imageId
-
-
Constructor Detail
-
CreateProgressHandler
private CreateProgressHandler(ProgressHandler delegate)
-
-
Method Detail
-
getImageId
private java.lang.String getImageId()
-
progress
public void progress(ProgressMessage message) throws DockerException
Description copied from interface:ProgressHandlerThis method will be called for each progress message received from Docker.- Specified by:
progressin interfaceProgressHandler- Parameters:
message- the message to process- Throws:
DockerException- if a server error occurred (500)
-
-