コード例 #1
0
 private String getPrefix(ImageConfiguration config) {
   Map<String, String> refConfig = config.getExternalConfig();
   String prefix = refConfig != null ? refConfig.get("prefix") : null;
   if (prefix == null) {
     prefix = "docker";
   }
   return prefix;
 }
コード例 #2
0
  @Override
  public List<ImageConfiguration> resolve(ImageConfiguration config, Properties properties)
      throws IllegalArgumentException {
    String prefix = getPrefix(config);

    RunImageConfiguration run = extractRunConfiguration(prefix, properties);
    BuildImageConfiguration build = extractBuildConfiguration(prefix, properties);
    WatchImageConfiguration watch = extractWatchConfig(prefix, properties);

    String name = extractName(prefix, properties);
    String alias = withPrefix(prefix, ALIAS, properties);

    return Collections.singletonList(
        new ImageConfiguration.Builder()
            .name(name)
            .alias(alias != null ? alias : config.getAlias())
            .runConfig(run)
            .buildConfig(build)
            .watchConfig(watch)
            .build());
  }