com.github.dockerjava.api.model.Version.getApiVersion()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中com.github.dockerjava.api.model.Version.getApiVersion()方法的一些代码示例,展示了Version.getApiVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getApiVersion()方法的具体详情如下:
包路径:com.github.dockerjava.api.model.Version
类名称:Version
方法名:getApiVersion

Version.getApiVersion介绍

暂无

代码示例

代码示例来源:origin: testcontainers/testcontainers-java

Info dockerInfo = client.infoCmd().exec();
Version version = client.versionCmd().exec();
activeApiVersion = version.getApiVersion();
activeExecutionDriver = dockerInfo.getExecutionDriver();
log.info("Connected to docker: \n" +

代码示例来源:origin: arquillian/arquillian-cube

public VersionAssert hasApiVersion(String apiVersion) {
  isNotNull();
  if (!Objects.areEqual(this.actual.getApiVersion(), apiVersion)) {
    failWithMessage("Expected docker's apiVersion to be %s but was %s", apiVersion, this.actual.getApiVersion());
  }
  return this;
}

代码示例来源:origin: jenkinsci/docker-plugin

public FormValidation doTestConnection(
      @QueryParameter String uri,
      @QueryParameter String credentialsId,
      @QueryParameter String apiVersion,
      @QueryParameter int connectTimeout,
      @QueryParameter int readTimeout
  ) {
    try {
      final DockerServerEndpoint dsep = new DockerServerEndpoint(uri, credentialsId);
      final DockerAPI dapi = new DockerAPI(dsep, connectTimeout, readTimeout, apiVersion, null);
      try(final DockerClient dc = dapi.getClient()) {
        final VersionCmd vc = dc.versionCmd();
        final Version v = vc.exec();
        final String actualVersion = v.getVersion();
        final String actualApiVersion = v.getApiVersion();
        return FormValidation.ok("Version = " + actualVersion + ", API Version = " + actualApiVersion);
      }
    } catch (Exception e) {
      return FormValidation.error(e, e.getMessage());
    }
  }
}

代码示例来源:origin: arquillian/arquillian-cube

private void configureDockerExecutor() {
  when(version.getVersion()).thenReturn("1.1.0");
  when(version.getOperatingSystem()).thenReturn("linux");
  when(version.getKernelVersion()).thenReturn("3.1.0");
  when(version.getApiVersion()).thenReturn("1.12");
  when(version.getArch()).thenReturn("x86");
  when(dockerClientExecutor.dockerHostVersion()).thenReturn(version);
}

代码示例来源:origin: org.testcontainers/testcontainers

Info dockerInfo = client.infoCmd().exec();
Version version = client.versionCmd().exec();
activeApiVersion = version.getApiVersion();
activeExecutionDriver = dockerInfo.getExecutionDriver();
log.info("Connected to docker: \n  Server Version: " + dockerInfo.getServerVersion() + "\n  API Version: " + activeApiVersion + "\n  Operating System: " + dockerInfo.getOperatingSystem() + "\n  Total Memory: " + dockerInfo.getMemTotal() / (1024 * 1024) + " MB");

代码示例来源:origin: alexec/docker-maven-plugin

final Version version = versionCmd.exec();
builder = builder.withApiVersion(version.getApiVersion());

代码示例来源:origin: arquillian/arquillian-cube

private ReportBuilder createDockerInfoGroup(DockerClientExecutor executor) {
  Version version = executor.dockerHostVersion();
  final ReportBuilder reportBuilder = Reporter.createReport(DOCKER_HOST_INFORMATION)
      .addKeyValueEntry(DOCKER_VERSION, version.getVersion())
      .addKeyValueEntry(DOCKER_OS, version.getOperatingSystem())
      .addKeyValueEntry(DOCKER_KERNEL, version.getKernelVersion())
      .addKeyValueEntry(DOCKER_API_VERSION, version.getApiVersion())
      .addKeyValueEntry(DOCKER_ARCH, version.getArch());
  return reportBuilder;
}

相关文章