Annotation Interface DockerContainer


@Retention(RUNTIME) @Target(FIELD) public @interface DockerContainer
Docker Container
Annotation:
Description:
The @DockerContainer annotation requests the Docker Manager to allocate a slot and start a container on the infrastructure Docker Engines. The test can request as many containers as required within the limits set by the Docker Manager configuration.
Examples:
@DockerContainer(image="library/httpd:latest")
public IDockerContainer httpdContainer;
@DockerContainer(image="privateimage", start=false)
public IDockerContainer container1;
Extra:
The IDockerContainer interface gives the test access to the IPv4/6 address and the exposed port numbers of the Docker Container. The interface also enables the test to execute commands and retrieve the log and transfer files that are sent to and from the container.

See DockerContainer and IDockerContainer to find out more.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The image attribute provides the Docker Image that is used to create the Docker Container.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The dockerContainerTag is used to identify the Docker Container to other Managers or Shared Environments.
    The dockerEngineTag will be used in the future so that a container can be run on a specific Docker Engine type.
    boolean
    The start attribute indicates whether the Docker Container should be started automatically.
  • Element Details

    • dockerContainerTag

      String dockerContainerTag
      The dockerContainerTag is used to identify the Docker Container to other Managers or Shared Environments. If a test is using multiple Docker Containers, each separate Docker Container must have a unique tag. If two Docker Containers use the same tag, they will refer to the same Docker Container.
      Returns:
      The tag for this container.
      Default:
      "PRIMARY"
    • image

      String image
      The image attribute provides the Docker Image that is used to create the Docker Container. The image name must not include the Docker Registry as this is provided in the CPS. If using a public official image from DockerHub, then the image name must be prefixed with library/, for example library/httpd:latest, the Docker Manager will not default to the library namespace like the Docker commands do.
      Returns:
      the name of the image.
    • start

      boolean start
      The start attribute indicates whether the Docker Container should be started automatically. If the test needs to perform some work before the container is started, then start=false should be used, after which IDockerContainer.start() can be called to start the container.
      Returns:
      true if the docker container should be started automatically. false otherwise.
      Default:
      true
    • dockerEngineTag

      String dockerEngineTag
      The dockerEngineTag will be used in the future so that a container can be run on a specific Docker Engine type. You would not normally need to provide a Docker Engine tag.
      Returns:
      The docker engine tag associate with this container.
      Default:
      "PRIMARY"