"google-chrome" and "chromium-browser" were not found. Try setting the CHROMOTE_CHROME environment variable or adding one of these executables to your PATH. Error in initialize(...) : Invalid path to Chrome

I have a docker container running rstudio, and a piece of code takes a screenshot of a plot then save it as a png. In order to do this, the container needs chrome, as per the error:

"google-chrome" and "chromium-browser" were not found. Try setting the CHROMOTE_CHROME environment variable or adding one of these executables to your PATH. Error in initialize(...) : Invalid path to Chrome

I tried to include google-chrome in my image but fail in the build

The command '/bin/sh -c apt-get install ./google-chrome-stable_current_amd64.deb' returned a non-zero code: 1

Is there another way to include google-chrome or chromium-browser in my dockerfile?

My dockerfile is:

FROM rocker/verse

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends build-essential libpq-dev python3.8 
python3-pip python3-setuptools python3-dev
RUN pip3 install --upgrade pip

ADD . ./home/rstudio

ADD requirements.txt .
ADD install_packages.r .

# Miniconda and dependencies
RUN cd /tmp/ && \
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
    bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda3 && \
    /root/miniconda3/condabin/conda install -y python=3.7
ENV PATH=$PATH:/root/miniconda3/bin

#RUN npm install phantomjs-prebuilt --phantomjs_cdnurl=http://cnpmjs.org/downloads

# installing python libraries
RUN pip3 install -r requirements.txt

# installing r libraries
RUN Rscript install_packages.r

RUN if ! [[ "16.04 18.04 20.04 21.04 21.10" == *"$(lsb_release -rs)"* ]]; \
    then \
    echo "Ubuntu $(lsb_release -rs) is not currently supported."; \
    exit; \
fi

RUN sudo su
RUN apt-get update && apt-get install -y gnupg2

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

RUN curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list

RUN exit
RUN sudo apt-get update
RUN sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17

RUN chmod -R 777 /home/rstudio

# try to install chromote_chrome
RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install ./google-chrome-stable_current_amd64.deb