Class DockerConfiguration


public class DockerConfiguration extends EntityPropertiesBuilder<DockerConfigurationProperties>
Configuration of Docker, to be attached to a Job or an Environment. With Docker enabled, all eligible Tasks will be executed in a Docker container instead of being processed by the native operating system of the Bamboo agent.
See Also:
  • Constructor Details

    • DockerConfiguration

      public DockerConfiguration()
      Creates a new Docker configuration, which will be enabled by default.
  • Method Details

    • enabled

      public DockerConfiguration enabled(boolean enabled)
      Enable or disable Docker. Docker configuration is enabled by default.
    • image

      public DockerConfiguration image(@NotNull @NotNull 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 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 container
      containerDirectory - directory in the Docker container, where the volume should be mounted
    • dockerRunArguments

      public DockerConfiguration dockerRunArguments(@NotNull @NotNull 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 class EntityPropertiesBuilder<DockerConfigurationProperties>