Package dev.galasa.docker
Annotation Interface DockerContainer
Docker Container
- Annotation:
- Description:
- The
@DockerContainerannotation 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
IDockerContainerinterface 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.
SeeDockerContainerandIDockerContainerto find out more.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThedockerContainerTagis used to identify the Docker Container to other Managers or Shared Environments.ThedockerEngineTagwill be used in the future so that a container can be run on a specific Docker Engine type.booleanThestartattribute indicates whether the Docker Container should be started automatically.
-
Element Details
-
image
String imageTheimageattribute 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 withlibrary/, for examplelibrary/httpd:latest, the Docker Manager will not default to the library namespace like the Docker commands do.- Returns:
- the name of the image.
-
-
-
dockerContainerTag
String dockerContainerTagThedockerContainerTagis 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"
-
start
boolean startThestartattribute indicates whether the Docker Container should be started automatically. If the test needs to perform some work before the container is started, thenstart=falseshould be used, after whichIDockerContainer.start()can be called to start the container.- Returns:
- true if the docker container should be started automatically. false otherwise.
- Default:
- true
-
dockerEngineTag
String dockerEngineTagThedockerEngineTagwill 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"
-