Class DockerConfiguration
java.lang.Object
com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<DockerConfigurationProperties>
com.atlassian.bamboo.specs.api.builders.docker.DockerConfiguration
Configuration of Docker, to be attached to a
Job
or an Environment
. With Docker enabled,
all eligible Task
s will be executed in a Docker container instead of being processed by the native operating
system of the Bamboo agent.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Docker configuration, which will be enabled by default. -
Method Summary
Modifier and TypeMethodDescriptionprotected DockerConfigurationProperties
build()
dockerRunArguments
(@NotNull String... arguments) Add additional arguments to the 'docker run' command used to start docker container.enabled
(boolean enabled) Enable or disable Docker.Specify the name of the Docker image to use.Add a volume to the Docker configuration.Removes default volumes from the Docker configuration.
-
Constructor Details
-
DockerConfiguration
public DockerConfiguration()Creates a new Docker configuration, which will be enabled by default.
-
-
Method Details
-
enabled
Enable or disable Docker. Docker configuration is enabled by default. -
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
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 String hostDirectory, @NotNull @NotNull 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
Add additional arguments to the 'docker run' command used to start docker container.- Parameters:
arguments
- argument list
-
build
- Specified by:
build
in classEntityPropertiesBuilder<DockerConfigurationProperties>
-