# Build and Push to Docker Registry - Kaniko container runtime error ## Module Harness-CI ## Environment ## Issue While building and pushing an image to the docker registry, one can encounter the following error: ![](https://i.imgur.com/gehxftt.png) ``exit status 1 Found possible error on line 2. Log: kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue . Possible error: Kaniko container runtime error`` ## Resolution The resolution is to add an environment stage variable named "container" with a value "docker". ## Diagnostic Steps Follow these simple steps to do add a stage variable: - Go to variables ![](https://i.imgur.com/mApykIx.png) - Go to the stage where `build and push to docker` registry is step. - Go to `stage variable` -> `Add variable` - Write variable name as `container` and type will be `string` and then select `Save`. - Give the value of the variable as `docker`. ![](https://i.imgur.com/gH2nW42.png) - Click on `Apply Changes`.