How Do I Install Virtuoso Docker Container Image?

  1. Choose Docker Image:
    The remainder of this article focuses on Enterprise Edition 8.3; most content applies to all three, with minor adjustments.
  2. Download Docker Image:
    • To pull the latest Virtuoso 8.2 docker image to your local system, use the command:
      $ docker pull openlink/virtuoso-closedsource-8
    • To check the version of the Virtuoso binary, use the command:
      $ docker run openlink/virtuoso-closedsource-8 version
      This Docker image is using Virtuoso Universal Server (Enterprise Edition) Version 08.03.3319-pthreads as of Sep 9 2020, compiled for Linux (x86_64-generic-linux-glibc25).
  3. Creating a Sample Virtuoso Docker Instance:
    • Create a new virtuoso instance on your system with the following commands:
      $ mkdir my_virtdb
      $ cd my_virtdb
      $ docker run \
          --name my_virtdb \
          --interactive \
          --tty \
          --env DBA_PASSWORD=mysecret \
          --publish 1111:1111 \
          --publish 8890:8890 \
          --volume `pwd`:/database \
          openlink/virtuoso-closedsource-8:latest
    • This creates a new Virtuoso database in the my_virtdb subdirectory and starts a Virtuoso instance with the HTTP server listening on port 8890 and the ODBC / JDBC / ADO.Net / OLE-DB / ISQL data server listening on port 1111.
    • The docker image runs in foreground mode, allowing you to see its activity.
    • Access the Virtuoso HTTP server at http://localhost:8890/.
    • Shut down Virtuoso by pressing CTRL and C in the terminal session.
  4. Licensing:
    • If the Virtuoso Enterprise Edition binary cannot find a license, it will start with a restrictive courtesy license which allows limited concurrent connections and terminates the instance after 10 minutes of use.
    • Obtain a FREE Evaluation License via our License Generator Web Service (https://shop.openlinksw.com/license_generator/virtuoso/).
    • Place the resulting virtuoso.lic file in the newly created database/ directory alongside the virtuoso.ini on your local filesystem for the docker image to pick up on the next startup:
      $ docker cp virtuoso.lic my_virtdb:/database
      $ docker stop my_virtdb
      $ docker start my_virtdb
  5. Passwords:
    • When a new database is created, the docker image will use the Environment settings DBA_PASSWORD and DAV_PASSWORD to set passwords for the dba and dav user accounts.
    • If the DBA_PASSWORD environment variable is not set, a random password will be assigned to the dba user account, stored on the internal docker filesystem as /settings/dba_password.
    • If the DAV_PASSWORD environment variable is not set, it will be set to the DBA_PASSWORD and stored as /settings/dav_password.
    • These files will only be readable by the user who started the image. Use the following command to reveal the randomized passwords:
      $ docker exec -i -t my_virtdb cat /settings/dba_password
    • NOTE: Users are advised to immediately change the password and then remove this file from the filesystem.
  6. Persistent Storage:
    • To retain changes to the Virtuoso database, the database documents should be stored on the host file system.
    • The docker image exposes a /database volume that can be mapped to a local directory on the filesystem. If this directory is empty, the docker image will put an initial virtuoso.ini into the mapped directory and then create a new database.
  7. Stopping the Image:
    • When the docker image is running in foreground mode, shut down Virtuoso by pressing the CTRL and C buttons in that terminal session. Alternatively, use the following command in a different terminal:
      $ docker stop my_virtdb
  8. Restarting the Image:
    • Once the docker image has been registered with the docker run or docker create command on your local system, start it in the background using:
      $ docker start my_virtdb
    • For foreground mode, use:
      $ docker start -i -a my_virtdb
  9. Checking the Startup Log:
    • If the docker image is started in background mode, look at the recent output of the virtuoso process by running:
      $ docker logs my_virtdb
  10. Using isql to Connect:
    • To connect to your running Virtuoso instance, use the following command:
      $ docker exec -i my_virtdb isql 1111
    • You will be prompted for the dba account password.
    • NOTE: Multiple incorrect password attempts will lock the dba account for a couple of minutes.
  11. Using an Existing Database:
    • If the mapped directory contains a virtuoso.ini and accompanying database documents, the new docker image will attempt to use these.
    • NOTE: Directory paths in the virtuoso.ini should be relative to the internal directory structure of the docker image to function correctly.