Skip to content

Native entrypoint

The virtuoso-native-launch command is a wrapper entrypoint that configures Virtuoso from environment variables, then delegates to the original Docker image entrypoint. This enables using optimized Virtuoso configuration in docker-compose scenarios.

The standard virtuoso-launch command orchestrates Docker from outside the container. However, if you want to use Virtuoso in a docker-compose setup where the configuration is defined in environment variables, you need virtuoso-native-launch.

Example files are available in the repository root:

To run:

Terminal window
docker compose -f docker-compose.example.yml up
FROM openlink/virtuoso-opensource-7:latest
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --break-system-packages virtuoso-utilities
ENTRYPOINT ["virtuoso-native-launch"]
services:
virtuoso:
build:
context: .
dockerfile: Dockerfile.virtuoso
environment:
- VIRTUOSO_MEMORY=8g
- DBA_PASSWORD=mysecret
- VIRTUOSO_ESTIMATED_DB_SIZE_GB=50
- VIRTUOSO_ENABLE_WRITE_PERMISSIONS=true
- VIRTUOSO_EXTRA_DIRS_ALLOWED=/data,/imports
volumes:
- ./data:/opt/virtuoso-opensource/database
- ./imports:/imports
ports:
- "8890:8890"
- "1111:1111"
VariableDescriptionDefault
VIRTUOSO_MEMORYMemory limit (e.g., 8g, 4096m)~2/3 of container RAM
VIRTUOSO_DBA_PASSWORDDBA password (also accepts DBA_PASSWORD)dba
VIRTUOSO_ESTIMATED_DB_SIZE_GBPre-configure MaxCheckpointRemap for new DBs (auto-calculated from existing DB)-
VIRTUOSO_PARALLEL_THREADSCPU cores for query parallelizationAuto-detected
VIRTUOSO_ENABLE_WRITE_PERMISSIONSEnable SPARQL write (true, 1, yes)false
VIRTUOSO_NUMBER_OF_BUFFERSOverride automatic buffer calculationAuto-calculated
VIRTUOSO_MAX_DIRTY_BUFFERSOverride automatic dirty buffer calculationAuto-calculated
VIRTUOSO_DATA_DIRVirtuoso data directory/opt/virtuoso-opensource/database
VIRTUOSO_EXTRA_DIRS_ALLOWEDAdditional DirsAllowed paths (comma-separated)-
VIRTUOSO_ORIGINAL_ENTRYPOINTOriginal entrypoint to exec/virtuoso-entrypoint.sh
  1. Reads configuration from environment variables
  2. Calculates optimal buffer and threading settings (same formulas as virtuoso-launch)
  3. Updates virtuoso.ini with calculated settings
  4. Sets VIRT_* environment variables for threading configuration
  5. If write permissions are enabled, forks a background process to apply them after startup
  6. Executes the original Docker image entrypoint via os.execv()

The same memory-based configuration logic from virtuoso-launch applies:

  • Buffer calculation: NumberOfBuffers = (Memory * 0.85 * 0.66) / 8700
  • Dirty buffers: MaxDirtyBuffers = NumberOfBuffers * 0.75
  • MaxQueryMem: Remaining memory after buffers (80% margin)

Threading parameters are set as VIRT_* environment variables:

  • AsyncQueueMaxThreads = CPU_cores * 1.5
  • ThreadsPerQuery = CPU_cores
  • MaxClientConnections = CPU_cores * 2
  • HTTPServer_ServerThreads = CPU_cores * 2

The following SQL commands are executed:

DB.DBA.RDF_DEFAULT_USER_PERMS_SET('nobody', 7);
DB.DBA.USER_GRANT_ROLE('SPARQL', 'SPARQL_UPDATE');
Featurevirtuoso-launchvirtuoso-native-launch
Runs fromHost (outside container)Inside container
ConfigurationCLI argumentsEnvironment variables
Docker dependencyYes (creates container)No (is the entrypoint)
Use caseStandalone scriptsdocker-compose