Package com.bmuschko.gradle.docker
Class DockerExtension
- java.lang.Object
-
- com.bmuschko.gradle.docker.DockerExtension
-
public class DockerExtension extends Object
The extension for configuring the Docker communication via the remote API through theDockerRemoteApiPlugin
.Other convention plugins like the
DockerJavaApplicationPlugin
andDockerSpringBootApplicationPlugin
may further extend this extension as nested configuration elements.The following example demonstrates the use of the extension in a build script using the Groovy DSL:
docker { url = 'https://192.168.59.103:2376' }
-
-
Constructor Summary
Constructors Constructor Description DockerExtension(ObjectFactory objectFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Property<String>
getApiVersion()
The remote API version.DirectoryProperty
getCertPath()
The path to certificates for communicating with Docker over SSL.DockerRegistryCredentials
getRegistryCredentials()
The target Docker registry credentials.Property<String>
getUrl()
The server URL to connect to via Docker’s remote API.void
registryCredentials(Action<? super DockerRegistryCredentials> action)
Configures the target Docker registry credentials.
-
-
-
Constructor Detail
-
DockerExtension
public DockerExtension(ObjectFactory objectFactory)
-
-
Method Detail
-
getUrl
public final Property<String> getUrl()
The server URL to connect to via Docker’s remote API.Defaults to
unix:///var/run/docker.sock
for Unix systems andtcp://127.0.0.1:2375
for Windows systems.
-
getCertPath
public final DirectoryProperty getCertPath()
The path to certificates for communicating with Docker over SSL.Defaults to value of environment variable
DOCKER_CERT_PATH
if set.
-
getApiVersion
public final Property<String> getApiVersion()
The remote API version. For most cases this can be left null.
-
getRegistryCredentials
public final DockerRegistryCredentials getRegistryCredentials()
The target Docker registry credentials.
-
registryCredentials
public void registryCredentials(Action<? super DockerRegistryCredentials> action)
Configures the target Docker registry credentials.- Parameters:
action
- The action against the Docker registry credentials- Since:
- 6.0.0
-
-