Docker image - Service Virtualization Lab Server

This topic describes how to install the Service Virtualization Lab server on Linux using a Docker image.

Service Virtualization Lab Server Environment variables

The Service Virtualization Management accepts the following optional environment variable:

  • SV_LAB_SERVER_CONNECTOR_PORTS - the port range which the server uses for connector ports (e.g. 9000-9019)

Back to top

Ports and Directories

The Service Virtualization Lab server uses these ports:

  • 8445 - secure server management REST API
  • ${SV_LAB_SERVER_CONNECTOR_PORTS} - see the SV_LAB_SERVER_CONNECTOR_PORTS variable above.

Service Virtualization Lab server requires the following directory to persist data using a docker volume:

  • /opt/LabServer/log/ - server logs

Back to top

Run Service Virtualization Lab Server

You run the Service Virtualization Lab server using the docker run -d --name sv-lab-server command with its parameters.

The following command shows how to run Service Virtualization Lab server with all of its parameters:

docker run -d --name sv-lab-server \
-e SV_LAB_SERVER_CONNECTOR_PORTS=9000-9019 \
-p 8445:8445 -p 9000-9019:9000-9019 -h $(hostname) \
-v /opt/LabServer/log/ \
virtualization/sv-lab-server

Back to top

Configure the Service Virtualization Lab Server

The Service Virtualization Lab server can be configured by modifying the etc/server.properties file. To do this, you need to copy this file from the docker image into your host filesystem (the sv-lab-server container needs to have been already created).

docker cp sv-lab-server:/opt/LabServer/etc/server.properties .

You can uncomment and modify the configuration properties in the server.properties file and then run the sv-lab-server container with this configuration file by the following docker command (you need to remove previous sv-lab-server containers using the docker rm sv-lab-server command):

docker run -d --name sv-lab-server \
-e SV_LAB_SERVER_CONNECTOR_PORTS=9000-9019 \
-p 8445:8445 -p 9000-9019:9000-9019 -h $(hostname) \
-v $(pwd)/server.properties:/opt/LabServer/etc/server.properties \
-v /opt/LabServer/log/ \
virtualization/sv-lab-server

How to Use Your Own Server Certificate

The Service Virtualization Lab server uses a standard Java keystore to keep the certificate/key used for HTTPS on a REST API endpoint. By default, a self-signed "localhost" certificate/key is used. To change it, you need to create a keystore with its own certificate/key. If you have them in PKCS12 format, you need to import the PKCS12 key store into the Java keystore using the Java keytool:

keytool -v -noprompt -importkeystore -srckeystore server-cert.p12 -srcstoretype PKCS12 -srcstorepass <key-password> -destkeystore server.jks -deststoretype JKS -storepass <key-store-password> -keypass <key-password>

The server.jks keystore must be referenced from the server.properties using the following properties:

  • server.ssl.key-store=file:/opt/LabServer/etc/server.jks
  • server.ssl.key-store-password=<key-store-password>
  • server.ssl.key-password=<key-password>

For more details, see Install and Configure SV Lab.

You can use the following docker command to run the sv-lab-server container with this configuration file and your keystore:

docker run -d --name sv-lab-server \
-e SV_LAB_SERVER_CONNECTOR_PORTS=9000-9019 \
-p 8445:8445 -p 9000-9019:9000-9019 -h $(hostname) \
-v $(pwd)/server.properties:/opt/LabServer/etc/server.properties \
-v $(pwd)/server.jks:/opt/LabServer/etc/server.jks \
-v /opt/LabServer/log/ \
virtualization/sv-lab-server

Back to top

See also: