binder-examples / r

Using R with Jupyter / RStudio on Binder
BSD 3-Clause "New" or "Revised" License
222 stars 278 forks source link

How to run container with rstudio or shiny? #16

Closed vsoch closed 6 years ago

vsoch commented 6 years ago

Hey binder team! Could you provide an example of how to run the container using rstudio or shiny? I see where the server is located, and in testing (I think) you would just run the server.R with Rscript or similar, but I'm not sure how it should be done properly from outside the container, with a docker command. To start us off, here is a quick reference for how to get the (notebook) running:

docker run --rm -it -p 8888:8888 vanessa/repo2docker-r jupyter notebook --ip 0.0.0.0

Thank you!

choldgraf commented 6 years ago

hey @vsoch, I think you'll have better luck with this question in the repo2docker repo than this example repo (which is just focused on using RStudio/Shiny with Binder). Note that repo2docker is explicitly not meant to generate arbitrary docker images that are run outside the context of a JupyterHub. However your best bet would probably be to look at the Dockerfile that repo2docker generates using the configuration files in this repo as a base:

I believe the call would be

jupyter-repo2docker https://github.com/binder-examples/r --debug --no-build
vsoch commented 6 years ago

heyo @choldgraf ! Sorry I think I can be more specific - I'm looking to run the components of this repo (and you could even ignore that repo2docker exists, period!) How do I start up rstudio and shiny? The README mentions there are examples, so I'm guessing the code provided can run this? If you are able to give me hints about this, I can figure out the container business. Thanks!

cboettig commented 6 years ago

@vsoch If it helps, I have an example for this from a recent paper here: https://github.com/cboettig/noise-phenomena

You'll see there's a Dockerfile in the repo, which is what is used if you click the binder button on the repo to run online. But it's also just a vanilla docker image, e.g. you can clone the repo onto any docker-enabled machine and run docker build -t myimage an docker run -p 8888:8888 myimage. It should give you a link that can open directly into RStudio (or go new->RStudio from the jupyter hub menu).

vsoch commented 6 years ago

ahh I'm such a pancake! I found it!

image

I literally didn't know that "rstudio" was under "new" ... and now I've updated the docs so that other wayward pancakes don't get confused like me :)

https://github.com/vsoch/repo2docker-r#repo2docker-r-with-r

Thank you! Issue cleared, resolved, closing!

vsoch commented 6 years ago

Signed, wayward :pancakes:

choldgraf commented 6 years ago

lol this is the first time that I've seen pancake used in this context and I love it!