Rasa command not found while Docker Image

Hi there,

I’m following this guide Introduction to Docker – Rasa Learning Center and trying to run a bot from docker.

But after a successful run of RUN python -m pip install rasa, the next command of rasa is failing with error of rasa command not found.

Can anyone please help with what’s wrong? Here is my full Dockerfile.

# use a python container as a starting point
FROM python:3.9-slim

# install dependencies of interest
RUN python -m pip install rasa

# set workdir and copy data files from disk
# note the latter command uses .dockerignore
COPY . .

# train a new rasa model
RUN rasa train

# set the user to run, don't run as root
USER 1001

# set entrypoint for interactive shells

# command to run when container is called to run
CMD ["run", "--enable-api", "--port", "8080"]

Thank you in advance. I’m using Apple M1 Macbook Air with Docker Desktop on it.