dockfile opens incorrect file with CMD in Azure webapps

Viewed 27

I have the following dockerfile. I want to run the file APP.Rmd at the end (last line), but it is running a different file in my repo, APP1.Rmd.

I used APP1.Rmd as a test to see if it can be run on start up, which it could, and then performed some updates to APP.Rmd so that file would run, but it still pointed to the old file, even though it is no longer referenced in the Dockerfile.

I tried: 1 - Commented out the last lines, and rebuilt the image, and was able to open to the RStudio IDE.

2 - included the last lines again, and it again started APP1.Rmd.

3 - restart Azure web apps.

Neither of these options worked to start the file APP.Rmd

Can anyone suggest what I might be doing wrong

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

# make all app files readable (solves issue when dev in Windows, but building in Ubuntu)
RUN chmod -R 755 /bin

# expose port on Docker container
EXPOSE 3838

# rmarkdown::run("downloadDT.Rmd") # failed
CMD ["R", "-e", "rmarkdown::run('/home/rstudio/APP.Rmd', shiny_args = list(port = 3838, host = '0.0.0.0'))"]
0 Answers
Related