Build your own Docker Image

Build your own custom Docker Image of HyperTest

HyperTest's docker images uses node:20-bookworm-slim as a base docker image. If you want to use your own node image as base image for HyperTest, you can do so and rebuild the image with the following script.

To build your own custom image follow the steps given in this page

  1. Create the file named

# Load environment variables from .env file
if [ -f .env ]; then
    export $(cat .env | grep -v ^# | xargs)

# Clone the git repo
git clone https://${GIT_FT_PAT}

# Navigate into the cloned repository
cd v2-artifacts || exit

# Checkout to version of HT
git checkout ${HYPERTEST_VERSION}

# Function to parse dependenciesVersion.txt and extract version numbers
parse_dependencies() {
    local file="dependenciesVersion.txt"
    if [ -f "$file" ]; then
        prismaEngVersion=$(grep -E "^prismaEngVersion:" "$file" | sed 's/prismaEngVersion://' | tr -d '[:space:]')
        bcryptVersion=$(grep -E "^bcryptVersion:" "$file" | sed 's/bcryptVersion://' | tr -d '[:space:]')
        echo "Error: dependenciesVersion.txt not found"
        exit 1

# Parse dependenciesVersion.txt to extract version numbers

# Build Docker image
docker build -t ${DOCKER_IMAGE_NAME} \
             --build-arg NODE_BASE_IMAGE=${NODE_BASE_IMAGE} \
             --build-arg BCRYPT_VERSION=${BCRYPT_VERSION} .
  1. Create the file named .env

GIT_FT_PAT=<Fine_grained_PAT_received from HT Team(diff than NPM)>
HYPERTEST_VERSION=<Get the latest version from HT team>
NODE_BASE_IMAGE=<Node_base_image, we are using node:20-bookworn-slim>
  1. Update the auth token, docker image name and node base image in .env file

  2. Run the script using below command


The above script will do the following steps

  1. Clone the rsitory containing docker artifacts

  2. Fetch package versions from repo content for a few packages required to run HT

  3. Build a docker image based on the name and base image you passed in .env file

NOTE: The base image should have node (version 20 as of now) and npm installed in it

Last updated