@Override public String build(final Path directory, final String name, final BuildParam... params) throws DockerException, InterruptedException, IOException { return build(directory, name, new LoggingBuildHandler(), params); }
@Override public Set<String> load(final InputStream imagePayload) throws DockerException, InterruptedException { return load(imagePayload, new LoggingLoadHandler()); }
@Override public void pull(final String image, final RegistryAuth registryAuth) throws DockerException, InterruptedException { pull(image, registryAuth, new LoggingPullHandler(image)); }
protected DockerClient getNewDockerClient() throws Exception { if (isNullOrEmpty(DOCKER_HOST.dockerCertPath())) { return new DefaultDockerClient(DOCKER_HOST.uri()); } else { final Path dockerCertPath = java.nio.file.Paths.get(DOCKER_HOST.dockerCertPath()); return new DefaultDockerClient(DOCKER_HOST.uri(), new DockerCertificates(dockerCertPath)); } }
private static boolean imageExistLocally(DockerClient dockerClient, String image) throws DockerException, InterruptedException { try { dockerClient.inspectImage(image); return true; } catch (ImageNotFoundException e) { return false; } }
@Override public void push(final String image, final RegistryAuth registryAuth) throws DockerException, InterruptedException { push(image, new LoggingPushHandler(image), registryAuth); }
@Override public void create(final String image, final InputStream imagePayload) throws DockerException, InterruptedException { create(image, imagePayload, new LoggingPullHandler("image stream")); }
/** * Show events for a volume. * @param volume A volume name or id * @return EventsParam * @since API 1.22 */ public static EventsParam volume(final String volume) { return filter("volume", volume); }
/** * Always remove intermediate containers. * * @return BuildParam */ public static BuildParam forceRm() { return create("forcerm", "true"); }
/** * Filter networks by name. * @param name Matches all or part of a network name. * @return The ListNetworksParam for the given name. * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam byNetworkName(final String name) { return filter("name", name); }
/** * Return user-defined (custom) networks only. * @return The ListNetworksParam for user-defined networks. * @see #withType(com.spotify.docker.client.messages.Network.Type) * @see #builtInNetworks() * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam customNetworks() { return withType(CUSTOM); }
/** * Give extended privileges to the command. * * @return ExecCreateParam */ public static ExecCreateParam privileged() { return privileged(true); }
/** * Create a custom parameter. * * @param name custom name * @param value custom value * @return ListContainersParam */ public static ListContainersParam create(final String name, final String value) { return new ListContainersParam(name, value); }
/** * Show all containers. Only running containers are shown by default * * @param all Whether to show all containers * @return ListContainersParam */ public static ListContainersParam allContainers(final boolean all) { return create("all", all ? "1" : "0"); }
/** * Show images with a label. * * @param label The label to filter on * @return ListImagesParam */ public static ListImagesParam withLabel(final String label) { return withLabel(label, null); }
/** * Create a custom filter. * * @param name of filter * @param value of filter * @return ListVolumesParam * @since Docker 1.9, API version 1.21 */ public static ListVolumesParam filter(final String name, final String value) { return new ListVolumesFilterParam(name, value); }
@Override public void pull(final String image) throws DockerException, InterruptedException { pull(image, new LoggingPullHandler(image)); }
@Override public String build(final Path directory, final BuildParam... params) throws DockerException, InterruptedException, IOException { return build(directory, null, new LoggingBuildHandler(), params); }
@Override public void push(final String image) throws DockerException, InterruptedException { push(image, new LoggingPushHandler(image)); }
/** * Show events for a plugin. * @param plugin A plugin name or id * @return EventsParam * @since API 1.30 */ public static EventsParam plugin(final String plugin) { return filter("plugin", plugin); }