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:
@@ -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("", "", "", ""));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user