Building custom Docker images

You can use DataStax source code to build a custom Docker image for your environment.

Build an image

DataStax provides a code repository on Github for building custom Docker images. To build an image, do the following steps:

By default, Gradle downloads the DataStax tarballs from the DataStax Downloads page.

End User License Agreement (EULA). By downloading this DataStax product, you agree to the terms of the EULA.

To build a product image for a specific version, invoke a Grade task that follows this pattern:

  • gradlew command

  • Example

./gradlew build<product><version>Image
./gradlew buildServer6.0.6Image

Build all images

To build all images, run the following command, entering your DataStax Academy credentials for username and password.

./gradlew buildImages

To build more than one image with specific versions:

./gradlew buildServer6.0.6Image buildOpscenter6.5.0Image

To get the list of all available tasks, run:

./gradlew tasks

Build multiple product versions

To support multiple product versions without duplicating files, Docker build contexts are generated from source folders that contain FreeMarker templates (files with .ftl extensions). The following conventions are used:

  • Docker build contexts are generated from self-describing product folders. For example, server, opscenter, and studio.

  • All files without the .ftl extension are copied to the build context.

  • Files with .ftl extensions are processed as FreeMarker templates:

    • Template directives are written using angle bracket syntax.

    • Square bracket syntax is used for interpolations.

    • The processed files are copied to the build context without .ftl extension. For example, Dockerfile.ftl is copied as Dockerfile.

  • FreeMarker templates use the version variable:

    • version.major returns product version major number

    • version.minor returns product version minor number

    • version.bugfix returns product version bugfix number

    • The following version functions are available:

      • version.lowerThan('x.y.z') returns true if version is semantically lower than x.y.z

      • version.greaterEqualThan('x.y.z') returns true if version is semantically greater than or equal to x.y.z.

To customize the products or to use multiple product versions, modify the templates in their corresponding product folder.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com