Difficulty: Intermediate
Estimated Time: 15 minutes

Docker is a containerization platform that packages applications and their dependencies together so that they can be easily deployed across multiple environments.

How are containers different from virtual machines?
Virtual machines encapsulate an entire operating system (called a guest OS) and provide a self-contained, isolated environemnt in which to run applications. Therefore, virtual machines are often multiple gigabytes in size. Containers package an application with the files and environment necessary for it to run. Rather than providing their own operating systems, containers get OS services from the operating system where they are deployed.

In this scenario we will deploy a Web application, a Microserrvice and a Cassandra cluster in Docker.

We will:

  • Create a Docker network
  • Pull the images from Docker Hub
  • Deploy the Cassandra cluster
  • Deploy the Microservice
  • Test the Microservice to database connection
  • Deploy the Web application
  • Test the Web application
  • Shut down the containers
  • Re-create the application using Docker compose

Let's get started!

This scenario showed you how to deploy an application consisting of a Cassandra database, a Spring microservice and an Angular front ent in Docker.

In this scenario, we:

  • Pulled images from Docker Hub
  • Ran the images using docker run
  • Tested the microservice and frontend
  • Shut down the containers
  • Used docker compose to start the entire application at once

Enterrpises use Docker to deploy cloud-native applications but for enterprise-grade solutions most oragnizations use Kubernetes or for Cassandra -- K8ssandra!

Running Cassandra in Docker

Step 1 of 11

Start a Cassandra node in Docker

In this step, you will deploy a single Cassandra node in a Docker container. (Of course in a production environment we would create a cluster of multiple Cassandra nodes but for now we will create a single node.)

Start by creating a Docker network. Click the following.

docker network create cass-cluster-network

Click to pull an Apache Cassandra™ image from DockerHub.

docker pull cassandra

Start the Cassandra node using the Docker network we created earlier.

docker run -d --name nodeA --network cass-cluster-network cassandra

Click below to monitor the logs for nodeA.

docker logs -f nodeA

Watch until you see Startup Complete.

Startup Complete

Click to send a Ctrl-C to stop following the container's logs.


Congratulations, you have a (singe node) Cassandra cluster running in Docker!