Package dev.galasa.docker
Annotation 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.
SeeDockerContainer
andIDockerContainer
to find out more.
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThedockerContainerTag
is used to identify the Docker Container to other Managers or Shared Environments.ThedockerEngineTag
will be used in the future so that a container can be run on a specific Docker Engine type.boolean
Thestart
attribute indicates whether the Docker Container should be started automatically.
-
Element Details
-
image
String imageTheimage
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 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 dockerContainerTagThedockerContainerTag
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"
-
start
boolean startThestart
attribute indicates whether the Docker Container should be started automatically. If the test needs to perform some work before the container is started, thenstart=false
should 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 dockerEngineTagThedockerEngineTag
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"
-