Running Shiny from JupyterLab in a container

Is it possible to run a Shiny app from inside a Jupyter notebook that's running in a container?

Here's some basic code. If I run this by using Visual Studio Code and remoting into the container it works: I can navigate to the displayed URL in the browser and see the app.

library(shiny)
runExample("01_hello")

However, if I try to run the same code in a notebook, using the JupyterLab interface, it fails to connect:

The image is based on the standard jupyter/datascience-notebook image from Docker Hub.

I also tried to specify a port number and open that port in the docker run command, but it didn't seem to do anything.

FWIW this isn't my preferred method of running Shiny in a container; we got a notebook from a colleague that does this, and I'm trying to make it work.

have you try to run on all interface, eg. runExample("01_hello", host = getOption("shiny.host", "0.0.0.0")) and access it like http://YOUR-WIFI-OR-LAN-IP:5749/

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.