Class DockerConfiguration

    • Constructor Detail

      • DockerConfiguration

        public DockerConfiguration()
        Creates a new Docker configuration, which will be enabled by default.
    • 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 container
        containerDirectory - 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