Menu

Automation Host Docker Setup Instructions

In this article, we will walk you through how to setup the automation agent host in Docker environment.

1. Download the latest automation agent host package here, then unzip it into a new folder.

2. Create a Dockerfile in the unzipped folder, and enter content as below:

FROM openjdk:9-jdk
RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
WORKDIR /agent
ADD $TheNameOfYourUnzippedAgentFolderYouJustDownloaded /agent/
RUN ./agentctl config -Phost=0.0.0.0 -Pport=6789 -Pqtest.url=$YourQTestInstanceUrl -Pqtest.token=$YourAPITokenGoesHere
EXPOSE 6789
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

Note:

  • $TheNameOfYourUnzippedAgentFolderYouJustDownloaded: replace this value with the agent folder name
  • $YourQTestInstanceUrl: replace this value with your qTest Site URL
  • $YourAPITokenGoesHere: replace this value with your qTest API token [TODO: guide how to get qTest API token]

3. Create a file called entrypoint.sh and make it executable

Open Entrypoint.sh in your favorite text editor and enter content as below:

#!/usr/bin/env bash
echo Args are "$@"
# $@ should be the -Phostname=name field
./agentctl start $@

4. Build the image:

docker build -t $nameOfBaseAgentImage .

  • $nameOfBaseAgentImage should be the name you want to reuse for your docker image; all lower case required

5. Run the container with the desired port and hostname:

docker run --name agent1 -tip 9002:6789 baseagent2image -PHostname=testdocker

Note: testdocker is the name of the host, 9002 is the port it will run on

Subscribe To Our Blog
Powered by Zendesk