Skip to content

Advanced Docker Usage

Follow these steps to start the Yellowbrick Community Edition (YBDCE) manually.

Prerequisite

  • Ensure that Docker is installed and running on your machine.

Step 1: Set Environment Variables

Set the necessary environment variables.

Note: These variables are provided as references; you can name them however you prefer.

bash
export DATA_DIR="$(pwd)/local_data"
export NODE_NAME="ybd-ce"
export VOLUME_NAME="ybd-storage"
export VOLUME_NAME_RFS="ybd-storage_rfs"
export VOLUME_NAME_LFS="ybd-storage_lfs"

Step 2: Determine Architecture

Check your system's architecture and set the appropriate variable. This will be required to pull the correct image for your local machine.

If your CPU architecture is x86_64, set the following variable:

export arch="amd64"

Step 3: Create Docker Volumes

Create the necessary Docker volumes.

bash
docker volume ls --format '{{ .Name }}' | grep -qw $VOLUME_NAME || docker volume create $VOLUME_NAME
docker volume ls --format '{{ .Name }}' | grep -qw $VOLUME_NAME_RFS || docker volume create $VOLUME_NAME_RFS

Step 4: Create Volume for Local Data Loading

The Community Edition allows Local Data Loading. To set it up, a local docker volume needs to be mounted in the ybd-ce container.

If you are running Docker in any windows or linux environment, execute the following command to simply set the local directory:

export VOLUME_NAME_LFS=$DATA_DIR

Step 5: Create Docker Container

Run a new Docker container with the specified configurations.

bash
docker run -d --name $NODE_NAME --hostname $NODE_NAME --privileged \
    -v $VOLUME_NAME_RFS:/var/lib/k0s \
    --cgroupns=host -v $VOLUME_NAME:/mnt/ \
    -v $VOLUME_NAME_LFS:/local_data/ \
    -v /sys/fs/cgroup:/sys/fs/cgroup:rw \
    -p 7443:6443 -p 5432:5432 -p 8443:443 \
    "yellowbrickdata/ybd-ce-k0s-$arch:stable"

Step 6: Retrieve Admin Credentials

Get the password and username for accessing the Yellowbrick UI after the YB instance is up and running.

bash
logs=$(docker logs $NODE_NAME 2>&1)
URL="https://localhost:8443/"
LINK_TEXT="Yellowbrick UI:"
echo "$LINK_TEXT ($URL)"
echo "Username: 'ybdadmin'"
password=$(echo "$logs" | grep "YB instance generated password:")
echo "Password: $password"