A Parasoft Docker image is a template that includes the Parasoft Virtualize Server, Parasoft Continuous Testing Platform, Parasoft Data Repository Server, all required software dependencies (e.g., Apache Tomcat, JRE …), and default configuration settings for connecting to Parasoft License Server. In this section:

Prerequisites

Ensure that you meet the system requirements for the following components:

Parasoft Virtualize ServerSee Parasoft Virtualize Server WAR File Deployment
Continuous Testing PlatformSee CTP Installation Guide
Parasoft Data Repository
  • Windows 64-bit distributions for 2008 R2 and higher
  • The following Linux 64-bit distributions:
    • Amazon
    • Debian 7
    • RHEL 5, 6, 7
    • SUSE 11
    • Ubuntu 12.04, 14.04, 14.10
  • Mac OS X

Licensing 

The machine ID used for licensing Parasoft products deployed in Docker is derived from the Docker container ID. If you clone the Docker container, the clone will have a different machine ID and require a new license unless you have a floating license. For floating license issued from License Server, we recommend using License Server on the network outside of Docker. Contact your Parasoft representative if you have any additional questions about licensing.

Configuring a New Docker Image 

To deploy on Docker, you configure default connection details in a configuration file, build Docker images, then run the soavirt Docker image.

  1. Download and install Docker for Windows as described in https://docs.docker.com/docker-for-windows/. This page contains Windows instructions and links to Linux and Mac instructions.
  2. Launch a Command Prompt and change directory (cd) to the folder where the Parasoft Docker files were extracted. This folder will contain the following subfolders
    • ctp
    • datarepository 
    • server-jre8 
    • soavirt 
    • tomcat8
  3. (Optional) Edit the default values for environment variables in the soavirt/Dockerfile file and ctp/Dockerfile file. The ENV command declares a new environment variable. The environment variable name and value should be separated by a space.

    VariableDescription
    ENV VIRTUALIZE_SERVER_NAME Docker

    Specifies the name that should be used to label this server on Environment Manager.

    ENV CTP_HOST localhost

    The host name or IP address of the CTP server where this Virtualize server should register when it starts up. If your CTP is running on localhost outside of the Docker container, specify the IP address (e.g., 10.10.255.47) rather than localhost.

    ENV CTP_PORT 8080

    The port that should be used to connect to CTP.

    ENV CTP_USERNAME admin

    The username that should be used to connect to CTP (if authentication has been enabled).

    ENV CTP_PASSWORD admin

    The password that should be used to connect to CTP (if authentication has been enabled).

    ENV CTP_NOTIFY true

    If true, the Virtualize server notifies CTP when virtual assets are deployed.

    ENV LICENSE_EDITION custom_edition

    The Virtualize license edition to request from the License Server.

    ENV LICENSE_FEATURES "Service Enabled, Performance, Extension Pack, Validate, Message Packs, Unlimited Hits\/Day"

    The Virtualize license features to request from the License Server when using a custom edition license.

    ENV LICENSE_SERVER_HOST localhost

    The host name or IP address of the License Server to use for requesting a Virtualize license.

    ENV LICENSE_SERVER_PORT 2002

    The port to use for connecting to License Server.

    How to Exclude Data Repository

    If you do not want to include Data Repository in the Docker image, change the first line of the soavirt/Docker file from FROM datarepository to FROM tomcat8


  4. Build Docker images for each of the sub folders by executing the following commands in the Docker Terminal in this order:

    docker build -t server-jre8 server-jre8/
    docker build -t tomcat8 tomcat8/
    docker build -t datarepository datarepository/
    docker build -t soavirt soavirt/
    docker build -t ctp ctp/
  5. Execute a command to run the newly created Docker image using the following format:

    docker run -it --rm -p 8080:8080 -p 9080:9080 ctp

    This will start up the Data Repository server, Virtualize server, and CTP.

    CTP already running outside of the Docker container

    If CTP is already running outside of the Docker container, run the soavirt Docker image instead:

    docker run -it --rm -p 2424:2424 -p 9080:9080 soavirt

    The -it option makes the running Docker container interactive so it will continue running until you press Ctrl-C in the terminal.

    The -rm option configures CTP and the Virtualize server as a disposable sandbox. Upon shutdown, the Docker container will be removed and discard any changes to the CTP database, Virtualize workspace, and Data Repository. Don't use this option if you want to be able to shut down CTP and Virtualize and then pick up where you left off after a restart.

    Setting -p 2424:2424 maps port 2424 from the Docker container to port 2424 in the host (for Data Repository).

    Setting -p 8080:8080 maps port 8080 from the Docker container to port 8080 in the host (for CTP).

    Setting -p 9080:9080 maps port 9080 from the Docker container to port 9080 in the host (for Virtualize).

You should now see the Virtualize server listed in CTP and be able to use the CTP web interface (by default, at http://localhost:8080/) to create virtual assets or upload .pva files.

How to Create a Docker Image with Only CTP (No Data Repository or Virtualize)

If you want to create a Docker image with just CTP and no Data Repository or Virtualize, change the first line of the ctp/Dockerfile from FROM soavirt to FROM tomcat8 and then rebuild the ctp image.

Changing the Configuration

If you want to override the default configuration (for example, to use a different CTP or License Server) without rebuilding the soavirt and ctp images, do the following:

  1. Shut down the running container.
  2. Override the environment variables in the run command using the -e option and environment variable name/value separated with an equals sign. 
Example 1
docker run -it --rm -p 2424:2424 -p 9080:9080 -e CTP_HOST=em.acme.com -e CTP_PORT=8080 -e LICENSE_SERVER_HOST=ls.acme.com soavirt
Example 2
docker run -it --rm -p 2424:2424 -p 9080:9080 -e CTP_HOST=10.10.255.47 -e CTP_PORT=8080 -e LICENSE_SERVER_HOST=license.parasoft.com soavirt

You should now see the Virtualize server listed in CTP and be able to use the CTP web interface (by default, at http://localhost:8080/) to create virtual assets or upload .pva files.

Changing the Configuration Defaults Inside Docker Images

You can change the configuration defaults inside the Docker image, which involves rebuilding the ctp and soavirt images.

  1. Shut down the Docker container (e.g., press Ctrl-C in the terminal).
  2. Delete the soavirt and ctp images:
    1. At the Docker terminal, enter the following command:

      docker images
       
    2. Remove the ctp image by entering the following command

      docker rmi ctp
       
    3. Remove the soavirt image by entering the following command

      docker rmi soavirt
       
    4. Verify that the images were removed by entering the following command

      docker images
       
  3. Edit the ctp/Dockerfile and soavirt/Dockerfile files as desired.
  4. Rebuild from the base folder in the Docker terminal by entering the following commands

    docker build -t soavirt soavirt/
    docker build -t ctp ctp/


  • No labels