diff --git a/src/main/java/org/apache/mesos/mini/MesosCluster.java b/src/main/java/org/apache/mesos/mini/MesosCluster.java index b8ee1b6f..0db961e3 100644 --- a/src/main/java/org/apache/mesos/mini/MesosCluster.java +++ b/src/main/java/org/apache/mesos/mini/MesosCluster.java @@ -103,15 +103,26 @@ public String addAndStartContainer(AbstractContainer container) { return container.getContainerId(); } + /** + * Inject an image (with tag "latest") from your local docker daemon into the mesos cluster. + * + * @param imageName The name of the image (without tag) you want to push (in the format domain/image) + * @throws DockerException when an error pulling or pushing occurs. + */ + public void injectImage(String imageName) throws DockerException { + injectImage(imageName,"latest"); + } + /** * Inject an image from your local docker daemon into the mesos cluster. * * @param imageName The name of the image you want to push (in the format domain/image) + * @param tag The tag of image to inject (e.g. "1.0.0" or "latest") * @throws DockerException when an error pulling or pushing occurs. */ - public void injectImage(String imageName) throws DockerException { + public void injectImage(String imageName, String tag) throws DockerException { ImagePusher imagePusher = new ImagePusher(config.dockerClient, "localhost" + ":" + config.privateRegistryPort, getMesosContainer().getContainerId()); - imagePusher.injectImage(imageName); + imagePusher.injectImage(imageName, tag); } public State getStateInfo() throws UnirestException {