Unable to start the shinyproxy app

I am trying to run my applicaiton as shiny proxy app:
please find the Dockerfile content as below:

Docker file content

FROM openanalytics/r-base
RUN apt-get update && apt-get install -y
sudo
pandoc
pandoc-citeproc
libcurl4-gnutls-dev
libcairo2-dev
libxt-dev
libssl-dev
libssh2-1-dev
libssl1.1
&& rm -rf /var/lib/apt/lists/*

RUN R -e “install.packages(c(‘shiny’, ‘rmarkdown’, ‘DBI’, ‘RPostgres’, ‘yaml’, ‘shinyTree’, ‘reactable’,
‘rhandsontable’, ‘stringr’, ‘dplyr’, ‘shinydashboard’), repos=)”

RUN mkdir /root/dps
COPY dps /root/dps

COPY Rprofile.site /usr/lib/R/etc/

EXPOSE 3838

CMD [“R”, “-e”, “shiny::runApp(’/root/dps’)”]

and the config looks like:

Application.yml

specs:

  • id: marine
    display-name: Marine’s Application
    description: Application which demonstrates the basics of a Shiny app
    container-cmd: CMD [“R”, “-e”, “shiny::runApp(’/root/dps’)”]
    container-image: dps_shiny

But when I execute the java -jar shinyproxy-2.5.0.jar then I get the following error:
Caused by: com.spotify.docker.client.exceptions.DockerRequestException: Request error: POST http://localhost:2375/containers/f6570331eb4ce33877ad3b9f5003cca8a8db5c46696e9cce996be750fee1de56/start: 400, body: {“message”:“OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “CMD [\“R\””: executable file not found in $PATH: unknown”}

Troubleshoot

and when I execute:
sudo docker run -p 3838:3838 dps_shiny R -e “shiny::runApp(’/root/dps’)”
[sudo] password for rk:

R version 4.0.5 (2021-03-31) – “Shake and Throw”
Copyright © 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type ‘license()’ or ‘licence()’ for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type ‘contributors()’ for more information and
‘citation()’ on how to cite R or R packages in publications.

Type ‘demo()’ for some demos, ‘help()’ for on-line help, or
‘help.start()’ for an HTML browser interface to help.
Type ‘q()’ to quit R.

shiny::runApp(’/root/dps’)
Loading required package: shiny

Listening on http://127.0.0.1:5601
@mnazarov please guide me.

@Mav9rick you also seem to have faced similar issue, could you please help me?

hi @rkagr, it seems that you have a typo in the container-cmd command - it should look like:

container-cmd: ["R", "-e", "shiny::runApp('/root/dps')"]

i.e. without CMD. See example in https://shinyproxy.io/documentation/configuration/
(also note that you can insert code chunks in your messages with triple ticks ```)

2 Likes

Thanks for the message.

I face one more problem,
I have the Rprofile.site also in my container but still I need to keep the container-cmd as
[“R”, “-e”, “shiny::runApp(’/root/dps’, host = ‘0.0.0.0’, port = 3838)”]
to make it work.

the content of Rprofile.site is
local({
options(shiny.port = 3838, shiny.host = “0.0.0.0”)
})

the shiny app is starting at random port.

On the first glance I don’t see a problem.
Do you have the Rprofile.site file in the folder from which you build the docker image?
You can check the contents of the Rprofile.site inside the docker image with:

sudo docker run dps_shiny cat /usr/lib/R/etc/Rprofile.site