1

I installed rstudio server by running:

docker run -d -p 8787:8787 -e USER='MY_USER' -e PASSWORD='MY_PASSWORD' rocker/hadleyverse

I would like to link (mount?) my local home directory (or a folder) to that docker container. Is that possible? how?

Thanks!

Ignacio
  • 7,646
  • 16
  • 60
  • 113

3 Answers3

2

You use -v or --volume to mount directories into a container. For example:

docker run -d \
           -p 8787:8787 \
           -e USER='MY_USER' \
           -e PASSWORD='MY_PASSWORD' \
           -v $HOME:/src \
           rocker/hadleyverse

Now your container will have a folder named /src with the contents of your local home folder.

Abdullah Jibaly
  • 53,220
  • 42
  • 124
  • 197
0

Use the -v flag:

docker run -d -p 8787:8787 -e USER='MY_USER' -e PASSWORD='MY_PASSWORD' -v $HOME:/data rocker/hadleyverse
Luís Bianchin
  • 2,327
  • 1
  • 28
  • 36
0

Please see the documentation entitled Sharing files with host machine in the wiki.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725