xqerl maintained by Zachary Dean, is an Erlang XQuery 3.1 Processor and XML Database.
- built from alpine 3.14.2 docker OS
- OTP 24.0.6 latest release
- built from latest xqerl merge commit
- uses config values in .env file to set some xqerl.config values. This is of interest only if you wish to build the image
yourself. In xqerl repo the
./config/xqerl.config
, itemenvironment_access
is set tofalse
. Our docker image is built with this var set totrue
. If you want to keep the default, clone this repo and in the file.env
setCONFIG_ENVIRONMENT_ACCESS=false
, then runmake
to build the image. - removed docker-compose example file instead you can clone this repo and use
make up
- in container added tzdata for timezone resolution. Set your timezone in the .env file.
- bin dir contains a terminal cli for xqerl
- doc pages
xqerl is in constant development, so I have also tagged images with the xqerl main git commit sha. These tagged images are available on dockerhub If you are testing or setting up a xqerl development environment, then it is advisable to use the latest sha tagged images. Any xqerl issues when developing with xqerl can be communicated back to the repo owner using the commit sha as a reference.
docker pull grantmacken/alpine-xqerl:1a94833e996435495922346010ce918b4b0717f2
Other pre-built images are available on dockerhub The latest xqerl docker release is also on github packages
On dockerhub I have provided two images
- interactive erlang shell: This image is a clone of xqerl repo with the entry point via
rebar3 shell
- production release: a smallish internet deploy image
This repo provides some helper tools, to help with you to work with xqerl
- Makefile at the project root.
- xq which is a bash cli executable in the 'bin' directory.
- a src directory, which is an example xqerl project layout.
make run-shell
This starts xqerl from ENTRYPOINT rebar3 shell
to pop you into
the interactive erlang shell.
The container contains a clone the xqerl repo so from here you should be able to follow the
Getting Started
tutorial from section 4 onwards.
This is a smallish (about 42MB) 'deploy' image, where a binary executable boots the xqerl environment,
Prior to running the container, I suggest you create a docker network and some docker volumes. Creating a prior network, allows a running xqerl container to join a network rather than creating a new network each time the container is started.
Created docker volumes allow us to persist our 'xquery code' and any data in the 'xqerl database'. We could mount bind, to a local directory, but created named volumes are more portable. Once the docker network and volumes are in place we can run the container.
In the Makefile I have an make up
and make down
target,
which sets this up for you using some config vars from the .env file
The docker run time instance includes
- A container run name: 'xq'
- A container hostname: 'xq'
- Two persistent docker volumes
- A volume named 'data' which holds the xqerl database data
- A volume name 'code' which holds the xqerl compiled xQuery beam files
- joining docker network named 'wrk'
- uses docker host environment variable
TZ
for setting local timezones - exposes published port: 8081
Once the container is up running, you can issue docker exec commands, like this ...
docker exec xq xqerl eval 'application:ensure_all_started(xqerl).'
docker exec xq xqerl eval "xqerl:run(\"xs:token('cats'), xs:string('dogs'), true() \")."
The above is not to very useful, so to really get started the thing first things you need to check out, is the xqerl documentation. There you will learn how how to ...
- compile your xquery files so they run on the OTP beam
- store update and retrieve data from the xqerl database
- use restXQ to create a restful web facing applications and APIs