RStudio Console from Docker Container

VS Code has support for Remote Containers. It allows the user to open any folder on their system in a docker container. I use this frequently for python development to ensure my development environment is always consistent. VS Code sends my python code to the Python Interactive Window and it is executed in the container's environment. This has huge and obvious benefits for dependency management.

Is something like this similar in RStudio? I would essentially like to replace the RStudio console with a console opened from within a Docker Container. Sending code to the console would then execute in the Container environment.

I think you might want to try the free/open RStudio Server in a docker container that is running either on your local/test system. Basically, RStudio is a browser of sorts, so there is very little difference in your experience using RStudio native app or the browser/RStudio-server. I've been switching between both for years, first as AWS-VMs, and then docker for the last few years. R Open Sci has helped demo and maintain example containers for some years now, and their emphasis on reproducible analysis is not so different from reproducible execution between test/deployment environments...

https://ropenscilabs.github.io/r-docker-tutorial/02-Launching-Docker.html
(also google "Rstudio docker rocker")

If you're using the "pro" version of RStudio products I think you might want to look at this quick blog post, but I haven't tried:

1 Like

Thanks for the response. I connected to the rocker/rstudio container and I think it does everything I want. Although a more general use case of attaching an editor to a remote console would help decouple the workflow from Rstudio for those who need it.