This Docker image runs MariaDB MaxScale. Two image variants can be built:
- Tini-based image running on Rocky Linux 8
- Minimal image running on Red Hat Universal Base Image 8 Minimal
The image type and the contained MaxScale version depend on the Git branch used.
Build the Tini-based image:
make build-image
Build the RHEL-UBI-based image:
make build-image MXS_VERSION=<mxs-version>
For example, to build an image with MaxScale 24.02.1 running on RHEL-UBI run
make build-image MXS_VERSION=24.02.1
Pull the latest MaxScale image from docker hub:
docker pull mariadb/maxscale:latest
Run the MaxScale container as "mxs":
docker run -d --rm --name mxs mariadb/maxscale:latest
The default configuration for the container is minimal and only enables the REST API.
The REST API by default listens on port 8989. The default user is "admin" with password "mariadb". Accessing it from the docker host requires a port mapping specified on container startup. The example below shows general information via curl.
docker run -d --rm -p 8989:8989 --name mxs mariadb/maxscale:latest
curl -u admin:mariadb http://localhost:8989/v1/maxscale
See MaxScale documentation for more information about the REST API.
Custom configuration can be given in an additional configuration file (e.g.
my-maxscale.cnf
). The file needs to be mounted into /etc/maxscale.cnf.d/
:
docker run -d --rm --name mxs -v $PWD/my-maxscale.cnf:/etc/maxscale.cnf.d/my-maxscale.cnf mariadb/maxscale:latest
docker exec -it mxs bash