how to run r in docker 1

how to run r in docker

docker run --rm -p 8787:8787 -v /path/to/local/dir:/home/rstudio/newdir username/docker_image_name:image_tag

Here is what the above code is Doing:
1. docker run: run this container…
2. –rm: automatically remove the container when it exits
3. -p 8787:8787: map port 8787 on the host to port 8787 in the container
4. -v /path/to/local/dir:/home/rstudio/newdir: mount the local directory /path/to/local/dir to /home/rstudio/newdir in the container
5. username/docker_image_name:image_tag: the name of the image to use with this container

Similar Posts