use of eu.openanalytics.shinyproxy.ShinyProxyException in project shinyproxy by openanalytics.
the class AbstractDockerBackend method initialize.
@Override
public void initialize() throws ShinyProxyException {
super.initialize();
DefaultDockerClient.Builder builder = null;
try {
builder = DefaultDockerClient.fromEnv();
} catch (DockerCertificateException e) {
throw new ShinyProxyException("Failed to initialize docker client", e);
}
String confCertPath = getProperty(PROPERTY_CERT_PATH);
if (confCertPath != null) {
try {
builder.dockerCertificates(DockerCertificates.builder().dockerCertPath(Paths.get(confCertPath)).build().orNull());
} catch (DockerCertificateException e) {
throw new ShinyProxyException("Failed to initialize docker client using certificates from " + confCertPath, e);
}
}
String confUrl = getProperty(PROPERTY_URL);
if (confUrl != null)
builder.uri(confUrl);
dockerClient = builder.build();
}
use of eu.openanalytics.shinyproxy.ShinyProxyException in project shinyproxy by openanalytics.
the class DockerSwarmBackend method initialize.
@Override
public void initialize() throws ShinyProxyException {
super.initialize();
String swarmId = null;
try {
swarmId = dockerClient.inspectSwarm().id();
} catch (Exception e) {
}
if (swarmId == null)
throw new ShinyProxyException("Container backend is not a Docker Swarm");
}
Aggregations