コード例 #1
0
 public static DockerContainer fromContainerInfo(ContainerInfo container) {
   Map<String, String> labels = container.config().labels();
   return new DockerContainer(
       container.name().substring(1),
       container.created(),
       GSON.fromJson(labels.get(Constants.CONFIGURATION_LABEL_KEY), HashMap.class),
       labels.get(Constants.ENVIRONMENT_LABEL_KEY));
 }
コード例 #2
0
  private static String image(Map<String, String> properties) {
    String image = properties.get("Image");

    if (isBlank(image)) {
      throw new IllegalArgumentException("Must provide `Image` attribute.");
    }

    if (!image.contains(":")) {
      return image + ":latest";
    }
    return image;
  }