-
Notifications
You must be signed in to change notification settings - Fork 13
How to use Docker
This package has the option of using Docker primarily to facilitate having the same environment between developers.
After installing Docker (and its extension Docker compose), go to the /docker directory in the package in your terminal.
Using Docker containers usually has two steps, one is where you either pull or build the Docker images you're interested in; the second is where you configure how the container starts and interact with it.
Here, we build the images locally, which is done on Linux by running sudo docker compose build.
Then, to start up the container, run sudo --preserve-env=HOME docker compose up -d [1] [2]
Then open up a web browser and type in 0.0.0.0:8787 or any equivalent. Log-in is USERNAME: rstudio and PASSWORD: password. Go into project then open up the cSEM.Rproj.
[1] Passing HOME as shown by Pete Freitag https://www.petefreitag.com/item/877.cfm
[2] The argument --preserve-env=HOME is needed on Linux to pass your local rstudio preferences (Stored in your home folder and not /root/, presumably) to be mounted and used. If not needed, comment out the relevant line in the docker-compose.yaml file and simply run sudo docker compose up -d.
# The relevant line
- ${HOME}/.config/rstudio/rstudio-prefs.json:/home/rstudio/.config/rstudio/rstudio-prefs.json