The DataStax base image now uses OpenJDK. Previously we were building with Oracle JDK. Starting with the below image versions and moving forward, prebuilt images on Docker Hub will include OpenJDK. If you would like to use OpenJDK with a version that was built with Oracle JDK we have built new images including OpenJDK with a tag of
Built on the best distribution of Apache Cassandra™, DataStax Enterprise is the always-on database designed to allow you to effortlessly build and scale your apps, integrating graph, search, analytics, administration, developer tooling, and monitoring into a single unified platform. We power your apps' real-time moments so you can create instant insights and powerful customer experiences.
Use the options described in this section to create DataStax Enterprise server containers.
By default, the DSE server image runs in Cassandra-only mode.. To run with advanced DSE functionality, add the option that enables any combination of search, analytics, and graph to the end of the docker run command.
|-s||Enables and starts DSE Search.|
|-k||Enables and starts Analytics.|
|-g||Enables and starts a DSE Graph.|
Combine startup options to run more than one feature. For more examples, see Starting DataStax Enterprise as a stand-alone process .
docker run -e DS_LICENSE=accept --name my-dse -d datastax/dse-server
docker run -e DS_LICENSE=accept --name my-dse -d datastax/dse-server -g
docker run -e DS_LICENSE=accept --name my-dse -d datastax/dse-server -k
docker run -e DS_LICENSE=accept --name my-dse -d datastax/dse-server -s
docker run -e DS_LICENSE=accept --name my-dse -d datastax/dse-server -s -k -g
Manage the DSE configuration using one of the following options:
DSE environment variables that change the configuration at runtime.
cassandra-env.shor DSE running inside the container due to java not honoring resource limits set for the container. Java utilizes the resources (memory and CPU) of the host. Otherwise DSE will set the heap to 1/4 of the physical ram of the docker host.
To use this feature:
Add the custom configuration files to the host directory you created.
docker run -e DS_LICENSE=accept --name my-dse -v /dse/config:/config -d datastax/dse-server
Note When you make changes to or add config files to the
/config volume, you will need to restart your container with
docker restart container_name for DSE to pickup the changes. Restarting the container will restart DSE.
Configure the DSE image by setting environment variables when the container is created using the docker run command
||accept||Required. Set to accept to acknowledge that you agree with the terms of the DataStax license. To show the license, set the variable
||IP_address||The IP address to listen for connections from other nodes. Defaults to the container's IP address.|
||IP_address||The IP address to advertise to other nodes. Defaults to the same value as the
||IP_address||The IP address to listen for client/driver connections. Default:
||IP_address||The IP address to advertise to clients/drivers. Defaults to the same value as the
||IP_address||The comma-delimited list of seed nodes for the cluster. Defaults to this node's
||Whether or not to start the Thrift RPC server. Will leave the default in the
||string||The name of the cluster. Default:
||int||The number of tokens randomly assigned to the node. Default: not set .|
||string||Datacenter name. Default:
||string||Rack name. Default:
||IP_address | string||Address of OpsCenter instance to use for DSE management; it can be specified via linking the OpsCenter container using opscenter as the name.|
||string||Allows setting custom Heap using -Xmx and -Xms.|
||string||Allows setting custom Locale|
||string||This variable sets the snitch implementation this node will use. It will set the endpoint_snitch option of cassandra.yaml. Default: GossipingPropertyFileSnitch|
||string||Sometimes users want to set all variables in the config files. For these situations one must prevent default environment variables from overriding those values. This setting lets you provide a comma-separated list of filenames (options are cassandra.yaml and cassandra-rackdc.properties) that will not accept the Environmental variables or can be set to 'all' to disable default environment variables being set within either file.|
To persist data, pre-create directories on the local host and map the directory to the corresponding volume using the docker run
NOTE: If the volumes are not mounted from the local host, all data is lost when the container is removed.
DSE images expose the following volumes.
For DataStax Enterprise Transactional, Search, Graph, and Analytics workloads:
/var/lib/cassandra: Data from Cassandra
/var/lib/spark: Data from DSE Analytics w/ Spark
/var/lib/dsefs: Data from DSEFS
/var/log/cassandra: Logs from Cassandra
/var/log/spark: Logs from Spark
/config: Directory to add custom config files for the container to pickup.
docker run -v <local_directory>:<container_volume>
See Docker docs > Use volumes for more information.
docker exec -it <container_name> command to specific commands.
docker exec -it my-dse nodetool status
If the container is running in the background (using the
-d), use the following command to open an interactive bash shell to run DSE commands.
docker exec -it <container_name> bash
To exit the shell without stopping the container type exit.
Use the following command to open cqlsh.
docker exec -it <container_name> cqlsh
You can view the DSE logs using the Docker log command. For example:
docker logs my-dse
Follow these steps to create an Opscenter container and a connected DataStax Enterprise server container on the same Docker host.
To create and connect the containers:
First create an OpsCenter container.
docker run -e DS_LICENSE=accept -d -p 8888:8888 --name my-opscenter datastax/dse-opscenter
Create a DataStax Enterprise (DSE) server container that is linked to the OpsCenter container.
docker run -e DS_LICENSE=accept --link my-opscenter:opscenter --name my-dse -d datastax/dse-server
Get the DSE container IP address:
docker inspect my-dse | grep '"IPAddress":'
Manage existing cluster.
host name, enter the DSE IP address.
Install agents manually. Note that the agent is already installed on the DSE image; no installation is required.
OpsCenter is ready to use with DSE. See the OpsCenter User Guide for detailed usage and configuration instructions.
Follow these steps to create a DataStax Studio container that is connected to a DataStax Enterprise (DSE) server container on the same Docker host.
To create and connect the containers:
docker run -e DS_LICENSE=accept --link my-dse --name my-studio -p 9091:9091 -d datastax/dse-studio
Studio is ready to use with DSE. See DataStax Studio User Guide for detailed usage and configuration instructions.
The code in this repository builds the DSE, Opscenter, DDAC and Studio Docker images. To get started, clone this repo and modify for your requirements.
This repo uses Gradle to build the images.
DOCKER_HOSTenv variable to the Docker engine you would like to build against (version 17.05+)
DataStax uses a common base image for all products. If you would like to customize the OS, install additional packages etc,
you would modify the
In order to support multiple product versions, but without duplicating files, Docker build contexts are generated out of source folders
that might contain FreeMarker templates (the files with
The following conventions are important to remember:
.ftlextension are copied to the build context AS IS
The files ending with
.ftl are processed as FreeMarker templates
Each FreeMarker template has access to
version.majorreturns product version major number
version.minorreturns product version minor number
version.bugfixreturns product version bugfix number
versionis semantically lower than
versionis semantically greater or equal than
If you would like to customize DSE, Opscenter, Studio or DDAC you would need to modify templates in their corresponding folder.
Building a product image for a given version requires invoking a Gradle task that follows the pattern:
For example: if you want to build DSE 5.1.10, you need to say
on the command line.
You can build many images at once:
./gradlew buildServer5.1.0Image buildServer6.7.0Image buildOpscenter6.7.0Image
Publishing an image to a registry (default: Docker Hub) requires invoking a Gradle task that follows the pattern:
Pushing to a private registry requires providing the registry url and the credentials either through project properties
on the command line or via
dockerRegistry=https://your.private.registry.org registryUsername=<USERNAME> registryPassword=<PASSWORD>
./gradlew tasks to get the list of all available tasks.
Head over to DataStax Academy for advanced documentation including
© 2020 Anant Corporation, All Rights Reserved. All logos, trademarks and registered trademarks are the property of their respective owners. .