During Harness CIE build and push step how to resolve the error "kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue"?

This happens when kaniko plugin is not able to figure out the container runtime of the process it is running in. This can be resolved by providing an environment variable ‘container’ with a supported [value].

Later this can be passed as a stage variable to the CIE pipeline.

Read more about:
Kaniko: GitHub - GoogleContainerTools/kaniko: Build Container Images In Kubernetes
CIE: CI Technical Reference - Harness Docs