Run qlever-control from within a Docker container with all required tools pre-installed.
This Docker container includes:
- Java (OpenJDK 17) - Required for qlever operations
- jq - JSON processor for data manipulation
- pipx - Python package manager
- qlever - Installed via pipx
- Docker CLI - To run Docker commands on the host VM
- unbuffer (from expect) - Disables output buffering for real-time logging
- lbzcat (from lbzip2) - Fast, parallel bzip2 decompression
Base image: Debian Bookworm (Slim)
Docker images are automatically built and pushed to GitHub Container Registry (ghcr.io) via GitHub Actions:
- On push to main/master: Tagged as
latest - On pull requests: Tagged with PR number
- On releases: Tagged with version numbers
Pull the pre-built image:
docker pull ghcr.io/gipplab/qlever-control:latest- Docker installed on your host machine
- Docker Compose (optional, but recommended)
-
Build and start the container:
docker-compose up -d
-
Access the container:
docker-compose exec qlever-control bash -
Stop the container:
docker-compose down
For production deployments using Docker Swarm, use the provided docker-stack.yml template:
-
Initialize Docker Swarm (if not already initialized):
docker swarm init
-
Deploy the stack:
docker stack deploy -c docker-stack.yml qlever
-
Check the service status:
docker stack services qlever docker service ps qlever_qlever-control
-
Access the container:
# Get the container ID/name docker service ps qlever_qlever-control --filter desired-state=running --format '{{.Name}}.{{.ID}}' # Access the container (replace CONTAINER_ID with actual ID from above) docker exec -it qlever_qlever-control.1.CONTAINER_ID bash
Or use this one-liner (if only one container is running):
docker exec -it $(docker ps -q -f name=qlever_qlever-control) bash
-
Remove the stack:
docker stack rm qlever
The docker-stack.yml template uses the latest pre-built image from GitHub Container Registry (ghcr.io/gipplab/qlever-control:latest) and includes:
- Resource limits and reservations
- Restart policies
- Update and rollback configurations
- Persistent volume for workspace data
Note: The service runs with replicas: 1 because the Docker socket mount prevents horizontal scaling. See the Security Note section below for important security considerations when mounting the Docker socket.
-
Build the image:
docker build -t qlever-control:latest . -
Run the container with Docker socket mounted:
docker run -it --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $(pwd)/workspace:/workspace \ qlever-control:latest
To test if the container can run Docker commands on the host, set the TEST_DOCKER environment variable:
docker run -it --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-e TEST_DOCKER=true \
qlever-control:latestOr with docker-compose, edit the docker-compose.yml file and set:
environment:
- TEST_DOCKER=trueThis will run docker run hello-world on startup to verify connectivity.
Once inside the container, you can use:
java -version- Check Java installationjq --version- Check jq installationpipx --version- Check pipx installationqlever --version- Check qlever installationdocker ps- Run Docker commands on the hostunbuffer --version- Check unbuffer installationlbzcat --version- Check lbzcat installation
/var/run/docker.sock- Docker socket for running Docker commands on host/workspace- Working directory for your files
TEST_DOCKER- Set totrueto test Docker connectivity on container startup (default:false)
Mounting the Docker socket (/var/run/docker.sock) gives the container full access to the Docker daemon on the host. This is equivalent to root access on the host machine. Only use this in trusted environments.
A test script is provided to verify all functionality:
./test.shThis will:
- Build the Docker image
- Verify all tools are installed correctly
- Test Docker connectivity
- Test docker-compose functionality
- Test workspace mounting