Anomaly Detection > Implementing Anomaly Detection > Install Anomaly Detection External Services > Results - Docker Install Process
  
Results - Docker Install Process
Docker Installation Process
1. Follow the procedure in Downloading Anomaly Detection Service Files to obtain the required files.
2. Load the extracted .tar file into the Docker repository on your host server as follows:
Open a command line terminal. (If you’re using a Windows operating system, open a Docker terminal window.)
Enter the following command with a path to the tar file (where you extracted it):
docker load < <file path>/<filename.tar>
Example: docker load < D:/testpath/testfile.tar
* 
Do not omit the less-than symbol (<) between docker load and the file path. See the example above.
To ensure that the tar file was loaded successfully, enter the following command and make sure the tar file is listed in the Docker registry:
docker images
3. Open a terminal window.
* 
If you are working with an older version Windows or Mac operating system (that does not run Docker natively), you must open the Docker Quickstart Terminal that was installed with the Docker Toolkit.
4. At the command line prompt, enter the entire run command, with all of its parameters, as shown below. The command should be entered all on a single line but is formatted below for readability purposes only.
docker run -d
-p 8080:8080
--name <resultContainerName>
-v <yourHostPath/db>:/tmp/
-v <yourHostPath>/microservices.properties:/maven/result-standalone.properties
twxml/result-standalone:2.0.3
-jar maven/result-standalone-2.0.3-bin.jar
server maven/results-h2-file.yml
Explanations for each parameter in the command are provide in the Run Command Parameter Explanations section. A sample of the entire run command is provided in the Sample Run Command section.
Run Command Parameter Explanations
Parameter
Explanation
docker run -d
Starts the Docker image as a separate process. If you omit the -d, the output will be printed to the terminal.
-p 8080:8080
-p 8080:8080
Maps the port 8080 from your host server to the Docker instance. You can change the mapping by changing the first value. For example, -p 8090:8080. In that case, REST calls will have to point to the new port instead of 8080.
* 
If the Results Microservice and the Training Microservice are installed on the same server, they cannot use the same port for the first value in their -p arguments. However, the second port must remain 8080 for both microservices. For example, if one is -p 8080:8080, the other could be -p 8090:8080.
--name <resultContainerName>
Assigns a name to the Results Microservice container, such as resultms. Assigning a container name makes the container easy to reference from other containers and in logs without the need to know the IP address or port.
-v <youHostPath/db>:/tmp/
Maps a folder from your host server to the Docker image where the H2 database can persist when the Docker image is restarted. Create a db folder on your server and enter the path to that location on the left side of the colon (:). On the right side, /tmp/ represents the location for the database on the Docker image. The syntax of the path on your server will vary depending on your operating system. For example:
Mac: -v /Users/myName/Downloads/ThingWatcher/db:/tmp/
Windows: -v //D/Users/myName/Downloads/ThingWatcher/db:/tmp/
-v <yourHostPath>/microservices.properties:/maven/result-standalone.properties
Maps the microservices.properties configuration file from your host server to the Docker image. For example:
Mac: -v /Users/myName/Downloads/ThingWatcher/microservices.properties:/maven/result-standalone.properties
Windows: -v //D/Users/myName/Downloads/ThingWatcher/microservices.properties:/maven/result-standalone.properties
* 
If you are using Docker Toolbox, substitute the left side of the mapping (before the colon) with the shared folder name that contains the properties file. This shared file is the one you mapped between the location of the properties file on your host server and the Docker Toolbox. See the Docker Installation subsection of Install Anomaly Detection External Services.
For example, if D is the shared folder: –v //D/microservices.properties:/maven/results–standalone.properties
twxml/result-standalone:2.0.3
Is the name of the provided Docker image that was loaded to the local Docker registry.
-jar maven/result-standalone-2.0.3-bin.jar
Is the name of the jar file in the Docker image (must be entered verbatim).
server maven/results-h2–file.yml
Is the .yml configuration file provided in the Docker image (must be entered verbatim).
Sample Run Command
docker run -d -p 8880:8080 --name result-standalone -v /root/ms/db:/tmp -v /root/ms/microservices.properties:/maven/results-standalone.properties twxml/result-standalone:2.0.3 -jar maven/result-standalone-2.0.3-bin.jar server /maven/results-h2-file.yml