0

I can't seem to solve this question, even though it seems that this has been answered here:

I am trying to run the rocker/tensorflow Docker container in Ubuntu 20.04 but I also need it to access the following folder /home/au687614/Documents/LUCAS_ML

So I tried to follow this answer and run this:

docker run -d -p 8787:8787 -v $(pwd):/home/au687614/Documents/LUCAS_ML:/home/rstudio/LOOKATMEEE -e ROOT=TRUE rocker/tensorflow

This however gets me the following error:

docker: Error response from daemon: invalid mode: /home/rstudio/LOOKATMEEE.
See 'docker run --help'

What is my mistake?

halfer
  • 19,824
  • 17
  • 99
  • 186
Derek Corcoran
  • 3,930
  • 2
  • 25
  • 54
  • Your syntax for `-v` is wrong, you have specified three path with `x:y:z`, when the argument takes to `x:y`. Just remove `$(pwd)`. – mhovd Jan 30 '23 at 06:00

1 Answers1

1

A correct syntax would be:

docker run -d -p 8787:8787 -e PASSWORD=yourpassword -v /path/to/your/local/folder:/home/rstudio/LOOKATMEEE:rw rocker/tensorflow

This comes from this e-book where you can find explanations about the syntax and other Docker essentials explained.

Barbara Gendron
  • 385
  • 1
  • 2
  • 16
  • Hey @Barbara, I tried this, but although the new folder LOOKATMEE appears in the session, it does not have any of the contents I have in my local folder, any idea of why? – Derek Corcoran Jan 30 '23 at 09:16
  • I am not a Docker expert but I would say that this command only mounts the `LOOKATMEEE` directory. Then, you can access it from RStudio, for instance, and save files in it. These files will automatically be saved also in the local directory you specified. – Barbara Gendron Jan 30 '23 at 09:37
  • Sorry @Barbara Gendron, it actually worked Cheers – Derek Corcoran Jan 31 '23 at 08:46