Build a Greengage DB Docker image
This topic describes how to build a Docker image with Greengage DB (based on Greenplum Database) and use this image to run a demo cluster in a Docker container. Using the resulting image, you can also run different test suites against a demo cluster. Learn more from How to run tests.
Prerequisites
To follow the steps described in this document, ensure you have git and Docker installed on your operating system. On Windows, you must also have Windows Subsystem for Linux (WSL) installed, as the build steps need to be executed inside a Linux environment.
Clone the Greengage DB repository
On Windows, make sure to clone the repository inside your WSL filesystem (for example, under /home/<user>).
-
Clone the greengage repository with submodules:
$ git clone --recurse-submodules https://github.com/GreengageDB/greengage.git -
Go to the greengage directory:
$ cd greengage -
Check out the branch used for Greengage DB 7:
$ git checkout 7.x
Build a Greengage DB Docker image
You can build a Greengage DB Docker image on both x86_64 and ARM64 hosts:
-
On x86_64, use a regular
docker build. -
On ARM64 (for example, Apple Silicon), use
docker buildxto produce an x86_64-compatible image.
Run the appropriate command from the greengage directory:
$ docker build -t greengagedb7:latest -f ci/Dockerfile.ubuntu .
$ docker buildx build --platform=linux/amd64 -t greengagedb7:latest -f ci/Dockerfile.ubuntu .
This builds the greengagedb7 image based on Ubuntu 22.04, including all required libraries and compiled binaries.
Work with a demo cluster
This section describes running a Docker container with Greengage DB and working with a demo cluster inside this container.
Run a Docker container
To create and run a Docker container for the demo Greengage DB cluster, execute the following command:
$ docker run \
--name greengagedb7_demo \
--rm \
-it \
--sysctl 'kernel.sem=500 1024000 200 4096' \
greengagedb7:latest \
bash -c "ssh-keygen -A && /usr/sbin/sshd && bash"
After creating and running the container, an interactive Bash shell session opens. You can now install and configure Greengage DB and then start the demo cluster.
Install and configure Greengage DB
-
Source the common.bash file:
$ source gpdb_src/concourse/scripts/common.bash -
Call the
install_and_configure_gpdbfunction defined in the common.bash file to unpack Greengage DB binaries to /usr/local/greengage-db-devel/:$ install_and_configure_gpdb
Create the Greengage DB administrative user
Execute the following script to create a system user account used to run and administer Greengage DB:
$ gpdb_src/concourse/scripts/setup_gpadmin_user.bash
This command creates the gpadmin user, generates an SSH key pair, and makes gpadmin the owner of /usr/local/greengage-db-devel/.
Start the cluster
Create and start the demo cluster by calling the make_cluster function:
$ make_cluster
Verify the cluster
To verify that the cluster works correctly, you need to connect to a database:
-
Switch to the
gpadminuser:$ su - gpadmin -
Set the Greengage DB path and environment variables as follows:
$ source /usr/local/greengage-db-devel/greengage_path.sh -
Source the gpdemo-env.sh file to set values of the
PGPORTandCOORDINATOR_DATA_DIRECTORYenvironment variables:$ source gpdb_src/gpAux/gpdemo/gpdemo-env.sh -
Connect to the default
postgresdatabase:$ psql postgresThe output should look like this:
psql (12.22) Type "help" for help. postgres=#
-
Get the version information about the installed Greengage DB:
SELECT version();The output might look like this:
PostgreSQL 12.22 (Greengage Database 7.4.0+dev.18.g6f3bcb96e8 build commit:6f3bcb96e84406c05798afb2cdd47ac928f286bc) on x86_ 64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0, 64-bit compiled on Nov 25 2025 13:55:19 (with asser t checking) Bhuvnesh C.