use of bio.terra.cli.app.utils.DockerClientWrapper in project terra-cli by DataBiosphere.
the class Image method execute.
/**
* Updates the docker image id property of the global context.
*/
@Override
protected void execute() {
Config config = Context.getConfig();
String prevImageId = config.getDockerImageId();
String newImageId = argGroup.useDefault ? Config.getDefaultImageId() : argGroup.imageId;
if (!new DockerClientWrapper().checkImageExists(newImageId)) {
ERR.printf("WARNING: Image %s was not found on the local machine. " + "Do `docker pull %s` to obtain it.%n", newImageId, newImageId);
}
config.setDockerImageId(newImageId);
if (config.getDockerImageId().equals(prevImageId)) {
OUT.println("Docker image: " + config.getDockerImageId() + " (UNCHANGED)");
} else {
OUT.println("Docker image: " + config.getDockerImageId() + " (CHANGED FROM " + prevImageId + ")");
}
}
use of bio.terra.cli.app.utils.DockerClientWrapper in project terra-cli by DataBiosphere.
the class AppLaunch method execute.
/**
* Updates the command runner option property of the global context.
*/
@Override
protected void execute() {
Config config = Context.getConfig();
Config.CommandRunnerOption prevAppLaunchOption = config.getCommandRunnerOption();
if (CommandRunnerOption.DOCKER_CONTAINER == mode) {
String imageId = Context.getConfig().getDockerImageId();
if (!new DockerClientWrapper().checkImageExists(imageId)) {
ERR.printf("WARNING: Image %s was not found on the local machine. " + "Do `docker pull %s` to obtain it.%n", imageId, imageId);
}
}
config.setCommandRunnerOption(mode);
OUT.println("App launch mode is " + config.getCommandRunnerOption() + " (" + (config.getCommandRunnerOption() == prevAppLaunchOption ? "UNCHANGED" : "CHANGED") + ").");
}
Aggregations