Simplify support for pushing images to unauthenticated registries

This commit removes the requirement that `docker.publishRegistry`
configuration must be provided when an image is published by the Gradle
or Maven plugin.

Fixes gh-28844
This commit is contained in:
Scott Frederick
2022-07-19 15:25:22 -05:00
parent e48f5de20f
commit 9b0cdac58a
14 changed files with 49 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,4 +90,9 @@ public final class DockerConfiguration {
new DockerRegistryUserAuthentication(username, password, url, email));
}
public DockerConfiguration withEmptyPublishRegistryAuthentication() {
return new DockerConfiguration(this.host, this.builderAuthentication,
new DockerRegistryUserAuthentication("", "", "", ""));
}
}