1
Image Selection
1. We’ve put together three Docker Images to choose from: <ul style="padding: 1rem 0 1rem 3rem"> <li>Enterprise Edition 8.3 – <a href='https://hub.docker.com/r/openlink/virtuoso-closedsource-8/'>openlink/virtuoso-closedsource-8</a></li> <li>Enterprise Edition 7.2 – <a href='https://hub.docker.com/r/openlink/virtuoso-closedsource-7/'>openlink/virtuoso-closedsource-7</a></li><li>Open Source (“VOS”) 7.2 – <a href='https://hub.docker.com/r/openlink/virtuoso-opensource-7/'>openlink/virtuoso-opensource-7</a></li></ul>
The remainder of this article is focused on Enterprise Edition 8.3.
2
Download Docker Image
2. To pull the latest Virtuoso 8.2 Docker image to your local system, use the command: <pre>$ docker pull openlink/virtuoso-closedsource-8</pre>. To check the version of the Virtuoso binary, use: <pre>$ docker run openlink/virtuoso-closedsource-8 version</pre>.
3
Creating a Virtuoso Docker Instance
3. Here is a quick example of how to create a new Virtuoso instance on your system:<pre>$ 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</pre> This will create a new Virtuoso database in the my_virtdb subdirectory and start a Virtuoso instance.
4
Licensing
4. If the Virtuoso Enterprise Edition binary cannot find a license, it will start with a restrictive courtesy license. Obtain a FREE Evaluation License via our License Generator Web Service (<a href='https://shop.openlinksw.com/license_generator/virtuoso/'>https://shop.openlinksw.com/license_generator/virtuoso/</a>). Place the resulting <strong>virtuoso.lic</strong> file in the newly created database/ directory alongside the <strong>virtuoso.ini</strong> on your local filesystem with the commands:<pre>$ docker cp virtuoso.lic my_virtdb:/database
$ docker stop my_virtdb
$ docker start my_virtdb</pre>.
5
Password Management
5. When a new database is created, the docker image will use the Environment settings <strong>DBA_PASSWORD</strong> and <strong>DAV_PASSWORD</strong> to set passwords for the <strong>dba</strong> and <strong>dav</strong> user accounts. If not set, random passwords are assigned and stored on the internal docker filesystem as <strong>/settings/dba_password</strong> and <strong>/settings/dav_password</strong>. Commands to reveal the passwords include:<pre>$ docker exec -i -t my_virtdb cat /settings/dba_password</pre>.
6
Persistent Storage
6. In order to retain changes to the Virtuoso database, the database documents should be stored on the host file system. The docker image exposes a <strong>/database</strong> volume that can be easily mapped to a local directory on the filesystem.
7
Control Docker Image
7. When the docker image is running in foreground mode (<strong>-i</strong> or <strong>--interactive</strong>), you can shut down Virtuoso by pressing <strong>CTRL</strong> and <strong>C</strong> buttons. Alternatively, use the command:<pre>$ docker stop my_virtdb</pre>.
7
Control Docker Image
8. Once the docker image has been registered with the docker run or docker create command, start it in the background using:<pre>$ docker start my_virtdb</pre> To run it in foreground mode, use:<pre>$ docker start -i -a my_virtdb</pre>.
8
Logging
9. If the docker image is started in background mode (without <strong>-i</strong> or <strong>--interactive</strong>), view the recent output of the Virtuoso process by running:<pre>$ docker logs my_virtdb</pre>.
9
Connection
10. To connect to your running Virtuoso instance, use:<pre>$ docker exec -i my_virtdb isql 1111</pre> You will be prompted for the <strong>dba</strong> account password. Note: Multiple incorrect password attempts will lock the dba account for a couple of minutes.
10
Using an Existing Database
11. If the mapped directory contains a <strong>virtuoso.ini</strong> and accompanying database documents, the new docker image will attempt to use these. Note: Directory paths in the <strong>virtuoso.ini</strong> should be relative to the internal directory structure of the docker image.