HammerDB prebuild Docker images can be downloaded directly from Official TPC-Council HammerDB DockerHub
docker pull tpcorg/hammerdb
docker tag tpcorg/hammerdb hammerdb
View all the Official TPC-Council HammerDB DockerHub images available here
Alternatively, Dockerfile can be used to build the same HammerDB client docker image that supports all the databases HammerDB is enabled for, i.e. Oracle, Microsoft SQL Server, MySQL, PostgreSQL and MariaDB, except for IBM Db2. We intend to add it in future releases. #404
docker build -t hammerdb .
docker run -it --name hammerdb hammerdb bash
Networking is needed to communicate with a remote database when starting the container
docker run --network=host -it --name hammerdb hammerdb bash
HammerDB prebuild Docker images can be downloaded directly from Official TPC-Council HammerDB DockerHub
docker pull tpcorg/hammerdb
Given the wide usage of docker containers is in cloud and emphasizes on being light weight. Here are Database specific Dockerfiles which builds client libarries only for the desired database. Find them here:
- MySQL, Readme
- MariaDB, Readme
- PostgreSQL, Readme
- Oracle Database, Readme
- Microsoft SQL Server, Readme
Alternatively, these pre built images can be downloaded from Official TPC-Council HammerDB DockerHub
docker pull tpcorg/hammerdb:mysql
docker pull tpcorg/hammerdb:maria
docker pull tpcorg/hammerdb:oracle
docker pull tpcorg/hammerdb:postgres
docker pull tpcorg/hammerdb:mssqls
CLI example scripts for each database are included under "scripts folder". Examples for TPROC-C and TPROC-H workloads are given both in python and tcl languages. These scripts are recommended to run from the HammerDB home directory, "/home/hammerdb/" This example Python script for MariaDB Database and HammerDB TPROC-C workload automate the following:
- builds schema
- run an TPROC-C workload test
- delete schema and
- write the results to "/home/hammerdb/TMP" directory.
./scripts/python/maria/tprocc/maria_tprocc_py.sh
Please note: Update the connection strings appropritaely in each of the following scripts before executing any experiments.
./scripts/python/maria/tprocc/maria_tprocc_buildschema.py
./scripts/python/maria/tprocc/maria_tprocc_run.py
./scripts/python/maria/tprocc/maria_tprocc_deleteschema.py
./scripts/python/maria/tprocc/maria_tprocc_result.py
Format is similar for every database while using both TCL or Python
To use HammerDB in GUI Mode from running within a Docker container, make sure X11 forwarding is configured and environment variable DISPLAY is set appropriately.
export DISPLAY=localhost:10.0
xhost+
docker run -it --rm -v ~/.Xauthority:/root/.Xauthority -e DISPLAY=$DISPLAY --network=host --name hammerdb hammerdb bash
Refer to HammerDB blog "How to deploy HammerDB CLI fast with Docker for more information.