How can I create a docker image of Virtuoso with a license in it

Hello @hrwilliams, please can I create a docker image of Virtuoso with a license in it using Dockerfile bearing in mind persistent volume? Thank you for your audience.

The docker FROM command could be used to create a new image from our base image to which a license file or anything else could be added if required.

Although note license files can only be used once, unless you have a special OEM type license, thus it would make more sense to simply copy the require license to the volume mount point where the Virtuoso config and database files are created when instantiated for a given container, as detailed in the OpenLink Virtuoso Enterprise Edition 8 Docker Image page, such that it gets picked up on startup.

FROM openlink/virtuoso-closedsource-8

RUN mkdir my_virtdb

RUN cd my_virtdb

COPY virtuoso.lic my_virtdb:/database

COPY virtuoso.lic 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

I USED THIS BUT STILL HAVING ISSUES WITH IT

@hwilliams PLEASE ASSIST

What issues are you having ?

What are the commands being run and any errors being reported when running them ?

Certainly the commands above do not make sense to me as you seem to be trying to create your own custom docker image and then starting the Virtuoso docker image, whereas you should be running your own custom docker image ?

If as per your actual docker command to run the openlink/virtuoso-closedsource-8:latest image where you are specifying –volume pwd :/database then if you simply place the Virtuoso license file (virtuoso.lic) in the pwd directory which is being mounted /database then Virtuoso will pick it up from that location on startup.

Thanks @hwilliams
I have created the image with the license in it and pushed to dockerhub.

my Dockerfile
FROM openlink/virtuoso-closedsource-8

RUN mkdir my_virtdb
COPY . .

COPY virtuoso.lic /my_virtdb/virtuoso.lic
COPY ./virtuoso.lic /my_virtdb:/database/virtuoso.lic

EXPOSE 8890:8890
EXPOSE 1111:1111

END

First issue; when i pull the image and docker run on my virtual machine on Azure

docker run --name virtuoso -p 8890:8890 -p 1111:1111 virtuoso8.0:1.0

the virtuoso server starts and takes over my terminal and when I exit the session (ctrl C) it shutdown the Server , how can I run the virtuoso instance without seeing the background process on my terminal

thanks
virtuoso

If you are confident your image will run as is then the -d option can be passed when first running it to run in detached mode ie

docker run -d --name virtuoso -p 8890:8890 -p 1111:1111 virtuoso8.0:1.0

or having pressed Ctrl^C to shutdown the container running in foreground mode you can simple start/stop it with the commands:

docker [start | stop] virtuoso

BTW, I still don’t see the point of the all the RUN and COPY commands in your dockerfile as what you are doing can simply be achieved with the following:

FROM openlink/virtuoso-closedsource-8

COPY ./virtuoso.lic /database/virtuoso.lic

with the virtuoso.lic file in the same directory the Dockerfile for building your custom image is located.

As stated before you should not be publishing custom docker images with license file to the public dockerhub service were it can be found publicly …

Thanks @hwilliams
The detach command worked , as for the license imaged on Dockerhub , it was for a developer test purpose and I have removed it. It will be pushed to a private cloud repo. Thanks