public class DockerConfiguration extends EntityPropertiesBuilder<DockerConfigurationProperties>
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 and Description |
---|
DockerConfiguration()
Creates a new Docker configuration, which will be enabled by default.
|
Modifier and Type | Method and Description |
---|---|
protected DockerConfigurationProperties |
build() |
DockerConfiguration |
dockerRunArguments(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(String image)
Specify the name of the Docker image to use.
|
DockerConfiguration |
volume(String hostDirectory,
String containerDirectory)
Add a volume to the Docker configuration.
|
DockerConfiguration |
withoutDefaultVolumes()
Removes default volumes from the Docker configuration.
|
public DockerConfiguration()
public DockerConfiguration enabled(boolean enabled)
public DockerConfiguration image(@NotNull String image)
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
).
public DockerConfiguration withoutDefaultVolumes()
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.
public DockerConfiguration volume(@NotNull String hostDirectory, @NotNull String containerDirectory)
Please note that some volumes are mounted by default. To get rid of default volume mappings, call
withoutDefaultVolumes()
.
hostDirectory
- directory on the Bamboo agent, which will be mounted in the Docker containercontainerDirectory
- directory in the Docker container, where the volume should be mountedpublic DockerConfiguration dockerRunArguments(@NotNull String... arguments)
arguments
- argument listprotected DockerConfigurationProperties build()
build
in class EntityPropertiesBuilder<DockerConfigurationProperties>
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.