Skip to content
This repository has been archived by the owner on Jun 22, 2018. It is now read-only.

Commit

Permalink
MesosCluster provides injectImage method which supports image tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
floriangrundig committed Aug 5, 2015
1 parent cb5d201 commit 527fe3b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/org/apache/mesos/mini/MesosCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 527fe3b

Please sign in to comment.