use of org.jreleaser.model.DockerConfiguration in project jreleaser by jreleaser.
the class DockerValidator method isAlpineCompatible.
private static boolean isAlpineCompatible(Distribution distribution, DockerConfiguration docker) {
List<Artifact> artifacts = distribution.getArtifacts().stream().filter(artifact -> artifact.getPath().endsWith(".zip")).collect(Collectors.toList());
if (docker instanceof DockerSpec) {
DockerSpec spec = (DockerSpec) docker;
Optional<Artifact> artifact = artifacts.stream().filter(spec::matches).findFirst();
if (artifact.isPresent()) {
spec.setArtifact(artifact.get());
return PlatformUtils.isAlpineLinux(artifact.get().getPlatform());
}
return false;
}
return artifacts.stream().anyMatch(artifact -> PlatformUtils.isAlpineLinux(artifact.getPlatform()));
}
Aggregations