Anomaly Detection > Implementing Anomaly Detection > Install Anomaly Detection External Services > Training - Docker Install Process
  
Training - 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 8090:8080
--name <trainingContainerName>
-v <yourHostPath>/microservices.properties:/maven/training-standalone.properties
twxml/training-standalone:2.0.5
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 8090:8080
Maps the port 8090 from the host server to the Docker instance. You can change the mapping by changing the first value. For example, -p 8095:8080. In that case, the REST calls will have to point to the new port instead of 8090.
* 
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 <trainingContainerName>
Assigns a name to the Training Microservice container, such as trainingms. 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 <yourHostPath>/microservices.properties:/maven/training-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/training-standalone.properties
Windows: -v //D/Users/myName/Downloads/ThingWatcher/microservices.properties:/maven/training-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/training-standalone:2.0.5
Is the name of the provided Docker image that was loaded to the local Docker registry.
Sample Run Command
docker run -d -p 8090:8080 --name training-standalone -v /root/ms/microservices.properties:/maven/training-standalone.properties twxml/training-standalone:2.0.5