Search in sources :

Example 1 with PushImageCmd

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;
}
Also used : PushImageCmd(com.github.dockerjava.api.command.PushImageCmd) AuthConfig(com.github.dockerjava.api.model.AuthConfig)

Aggregations

PushImageCmd (com.github.dockerjava.api.command.PushImageCmd)1 AuthConfig (com.github.dockerjava.api.model.AuthConfig)1