About Snyk test not working in my pipeline after the docker image is build

Hi, I am trying to scan docker image with snyk test --docker with Image name, it is not working.
Orb :snyk/snyk@1.4.0.

I have given ‘Image name’ in environment variables and also tried giving in the config file as an environment. But it is not working.

A Image is getting created in my local with a different id not test-runner

The problem is its not taking the IMAGE_NAME and the tag ‘latest’

version: 2.1
orbs:
snyk: snyk/snyk@1.4.0

jobs:
WEB:
machine: true
resource_class: ******/runner-test-snyk
environment:
IMAGE_NAME: test-runner

steps:
  - checkout
  - run: docker --version
  - run: node --version
  
  - run: 
      name: Build Docker Image
      command: |
       sudo docker build -t $IMAGE_NAME:latest .

  - snyk/scan:
      docker-image-name: $IMAGE_NAME:latest   

The above is the simple config file with my executor environment being ‘self-hosted runner’ with resource class name given in ****

Docker file
FROM node:latest as node

WORKDIR /app

COPY . .

RUN npm install

RUN npm run build

FROM nginx:alpine

COPY --from=node /app/dist/helloworld /usr/share/nginx/html.

The error I am getting is
Failed to scan image "*:". Please make sure the image and/or repository exist, and that you are using the correct credentials.

Exited with code exit status 2
CircleCI received exit code 2