Using Clarivize with Docker

Run Clarivize directly from the command line or use Docker Compose for a persistent, reusable configuration.

Command line

Directly run Clarivize

Directly running Clarivize with Docker will create a container that contains its own database. This means all configuration will be lost with the container.

PS> docker pull clvzdocker/clarivize:latest
PS> docker run -p 9876:9876 clvzdocker/clarivize:latest

With these commands, the new Clarivize container UX will be accessible via localhost:9876.

If you have an activation key, it can be used within the UX, or via command line. The command below assumes that FreeTrialActivationKey.json is in the current directory ($(pwd)). If the key file is elsewhere, use its full path.

PS> docker run -p 9876:9876 -v "$(pwd)/FreeTrialActivationKey.json:/app/key.json" -e CVZ_ACTIVATION_KEY=/app/key.json clvzdocker/clarivize:latest

Docker compose

Running Clarivize via a docker-compose.yml config file makes it easier to maintain the configuration and orchestrate with other components.

Stand-alone Docker Compose

Create docker-compose.yml and .env files in the same directory and add the text below. Download your JSON activation key in the same folder as activation_key.json.

Replace <PIPELINEID> in .env with an alphanumeric sequence of your own: 8-32 characters, with no spaces or special characters. [A-Z0-9]{8,32}

To run this configuration, use this command:

PS> docker compose up -d

.env file contents

# Clarivize - docker container
CLARIVIZE_PORT=9876

# the name of the container, can be used to configure other services to send data to Clarivize
CLARIVIZE_HOST=clarivize-c

# the name of the pipeline in Clarivize
CLARIVIZE_PIPELINE_ID=CL-<PIPELINEID>

# this is the connection URL, where telemetry can be sent for processing
CLARIVIZE_COLLECTOR_ENDPOINT=http://${CLARIVIZE_HOST}:${CLARIVIZE_PORT}/clarivize/${CLARIVIZE_PIPELINE_ID}

# This is the destination of telemetry coming out of Clarivize.
# Update the value with the actual destination URL
# Use "http://void.test" to not forward any telemetry
CLARIVIZE_FORWARD_ENDPOINT=http://otel-collector:4328

docker-compose.yml file contents

services:

# This init allows the mounted volume to be accessed by Clarivize
	clarivize-data-init:
		image: alpine:3.20
		user: 0:0
		volumes:
			- clarivize-data:/app/data
		command: ["sh", "-c", "chown -R 584792:584792 /app/data"]

# Clarivize service
	clarivize:
		image: clvzdocker/clarivize:latest
		container_name: ${CLARIVIZE_HOST}
		depends_on:
			clarivize-data-init:
				condition: service_completed_successfully
		labels:
#optional
			- "service.type=instrumentation"
		ports:
			- "${CLARIVIZE_PORT}:${CLARIVIZE_PORT}"
		volumes:
			- clarivize-data:/app/data
			- ./activation_key.json:/app/activation_key.json:ro
		environment:
			CVZ_DBTYPE: SQLite
			CVZ_CONN: Data Source=/app/data/Clarivize.db
			CVZ_USERNAME: ${CLARIVIZE_ACCOUNT}
			CVZ_PASSWORD: ${CLARIVIZE_PWD}
			CLARIVIZE_COLLECTOR_ENDPOINT: ${CLARIVIZE_COLLECTOR_ENDPOINT}
			CVZ_PIPELINE_ID: ${CLARIVIZE_PIPELINE_ID}
			CVZ_PIPELINE_PROVIDER_TYPE: otlp
			CVZ_PROVIDER_TARGET: ${CLARIVIZE_FORWARD_ENDPOINT}
			CVZ_ACTIVATION_KEY: /app/activation_key.json

volumes:
# define a stand-alone volume that can be reused when the container is deleted
	clarivize-data: