use of com.github.dockerjava.api.command.PushImageCmd in project camel by apache.
the class AsyncDockerProducer method executePushImageRequest.
/**
* Produces a push image request
*
* @param client
* @param message
* @return
*/
private PushImageCmd executePushImageRequest(DockerClient client, Message message) {
LOGGER.debug("Executing Docker Push Image Request");
String name = DockerHelper.getProperty(DockerConstants.DOCKER_NAME, configuration, message, String.class);
ObjectHelper.notNull(name, "Image name must be specified");
PushImageCmd pushImageCmd = client.pushImageCmd(name);
String tag = DockerHelper.getProperty(DockerConstants.DOCKER_TAG, configuration, message, String.class);
if (tag != null) {
pushImageCmd.withTag(tag);
}
AuthConfig authConfig = client.authConfig();
if (authConfig != null) {
pushImageCmd.withAuthConfig(authConfig);
}
return pushImageCmd;
}
Aggregations