How to deploy VocBench3 with Docker
To deploy VocBench3 using Docker, there are some non-intuitive steps when working from via SSH and a console. For my own reference, here are the steps I took in order to get it working.
Step 1: Prepare environment
I started the virtual machine and logged in via SSH, using the Visual Studio Code Remote SSH extension. I navigated to the applications directory and cloned the VocBench Docker repository and followed its instructions. Because at time of writing, the Docker repository was already updated to v11, but there was only a v10.2.1 download available, I had to revert the git repo too.
Finally, I had to make a local directory to persist the Docker data.
When containers are destroyed, so are its data directories, unless you’ve mirrored (not the extact parlance) them to a local folder.
The -v
option in the docker run
command maps that local directory to the container’s data directory.
$ git clone https://bitbucket.org/art-uniroma2/vocbench3-docker.git
$ git log # find out the commit for 10.2.1
$ git checkout bbb492d2dcd25d29c9727e69d1ad1ace15c50be0 # 10.2.1
$ mkdir -p volumes/stdata # A local directory to persist Semantic Turkey data
$ cd 10.2.1/
Step 2: Download VocBench in full
The VocBench Docker image is not distributed with the latest version of the application.
You can download that via de downloads page, but v11 was not available there yet.
The download URL also could not be simply downloaded with curl
or wget
, so I had to supply a dummy username and password.
$ wget -O ./vocbench3-10.2.1-full.zip --user "username" --password "password" https://bitbucket.org/art-uniroma2/vocbench3/downloads/vocbench3-10.2.1-full.zip
Step 3: Build, make a Docker volume for persistent data and run it
There is no need to extract that zip file, so we can proceed with building and running the VocBench container.
$ docker build -t vocbench3:10.2.1 .
$ cd ..
$ docker run -v ${PWD}/volumes/stdata:/opt/vocbench3/data -p 1979:1979 --name vocbench3-10.2.1-crow -t vocbench3:10.2.1
That’s all on the server side!
Now, via the SSH-tunnel I could map local and remote ports 1979 so I could explore the VocBench installation. You could also directly connect to the VM, if its firewall allows such.