Class DockerConfiguration
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<DockerConfigurationProperties>
-
- com.atlassian.bamboo.specs.api.builders.docker.DockerConfiguration
-
public class DockerConfiguration extends EntityPropertiesBuilder<DockerConfigurationProperties>
Configuration of Docker, to be attached to aJob
or anEnvironment
. With Docker enabled, all eligibleTask
s will be executed in a Docker container instead of being processed by the native operating system of the Bamboo agent.
-
-
Constructor Summary
Constructors Constructor Description DockerConfiguration()
Creates a new Docker configuration, which will be enabled by default.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DockerConfigurationProperties
build()
DockerConfiguration
dockerRunArguments(@NotNull java.lang.String... arguments)
Add additional arguments to the 'docker run' command used to start docker container.DockerConfiguration
enabled(boolean enabled)
Enable or disable Docker.DockerConfiguration
image(@NotNull java.lang.String image)
Specify the name of the Docker image to use.DockerConfiguration
volume(@NotNull java.lang.String hostDirectory, @NotNull java.lang.String containerDirectory)
Add a volume to the Docker configuration.DockerConfiguration
withoutDefaultVolumes()
Removes default volumes from the Docker configuration.
-
-
-
Method Detail
-
enabled
public DockerConfiguration enabled(boolean enabled)
Enable or disable Docker. Docker configuration is enabled by default.
-
image
public DockerConfiguration image(@NotNull @NotNull java.lang.String image)
Specify the name of the Docker image to use.You can define the repository host, namespace and tag for the image, by following the Docker image format (e.g.
localhost:5000/namespace/image:tag
).
-
withoutDefaultVolumes
public DockerConfiguration withoutDefaultVolumes()
Removes default volumes from the Docker configuration.By default, Bamboo maps some agent directories to corresponding directories in the Docker container. You can disable this behaviour and remove all volumes mounted by default by calling this method.
Use
volume(String, String)
to mount custom volumes to the Docker container.
-
volume
public DockerConfiguration volume(@NotNull @NotNull java.lang.String hostDirectory, @NotNull @NotNull java.lang.String containerDirectory)
Add a volume to the Docker configuration.Please note that some volumes are mounted by default. To get rid of default volume mappings, call
withoutDefaultVolumes()
.- Parameters:
hostDirectory
- directory on the Bamboo agent, which will be mounted in the Docker containercontainerDirectory
- directory in the Docker container, where the volume should be mounted
-
dockerRunArguments
public DockerConfiguration dockerRunArguments(@NotNull @NotNull java.lang.String... arguments)
Add additional arguments to the 'docker run' command used to start docker container.- Parameters:
arguments
- argument list
-
build
protected DockerConfigurationProperties build()
- Specified by:
build
in classEntityPropertiesBuilder<DockerConfigurationProperties>
-
-