Expect script not running in docker container

I’m trying to run expect script in docker container. I’ve installed expect

Docker file

FROM ubuntu:latest

RUN apt-get update 
  && apt-get install expect -y

Expect script

eval spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no [email protected]****
#use correct prompt
set prompt ":|#|$"
interact -o -nobuffer -re $prompt return
send "******r"
interact

I get the following error

bash: spawn: command not found

Please help

Source: StackOverflow