Rewriting my first sentence: Does /tf exist in the Vagrant VM? If it doesn't, you'll need to add a (vagrant-managed) shared directory from the `tf` directory on your host to a `/tf` directory on your guest.
On Thu, Dec 26, 2019 at 7:48 PM Jamie Jackson <[email protected]> wrote: > Does /tf exist in the Vagrant VM? If it doesn't, you'll need to add a > shared directory from your host vagrant directory and your guest (at /tf). > Otherwise, a way to do it without the extra step could be to use something > like `-v /vagrant/tf:/tf`, which would leverage the `/vagrant` share that > vagrant automatically gives you. That assumes that the `tf` directory lives > next to your Vagrantfile on the host, though. > > On Thu, Dec 26, 2019 at 7:34 PM Alexander Solla <[email protected]> > wrote: > >> I'm having a hard time with a Docker container I am trying to run in a >> vagrant/libvirt vm. (To be specific, it's the official Tensorflow >> container, with py3 and gpu and jupyter support). >> >> Here is the relevant fragment of my Vagrant file: >> >> authToken = SecureRandom.hex >> >> host.vm.provision :docker do |docker| >> docker.run "tensorflow/tensorflow", >> image: "tensorflow/tensorflow:latest-gpu-py3-jupyter", >> args: "-it -u 1000:1000 -p 8080:8888 -v /tf:/tf", >> cmd: "/bin/bash -c \"source /etc/bash.bashrc && jupyter notebook >> --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token='#{authToken}'\"" >> end >> >> If I vagrant up the relevant machine, it ends up printing out the authToken >> on my screen, and then I can log in to the Jupyter server on port 8080. So >> far so good. >> >> But, there's a problem. Jupyter can't find the files in /tf. >> >> On the other hand, if I go back to my virtual machine and stop the docker >> container, I can run that "same" command (by hand) and Jupyter works and >> sees the files. I can do this as either `vagrant` or `root`. Either one >> works (though, to be fair, I put `vagrant` into my `docker` group in an >> earlier provisioning step...) >> >> So this tells me that somehow, Vagrant or Docker are treating the command >> differently, based on how/when it's invoked. I am not sure what else to do, >> so I figured I'd ask here and on stack exchange, before escalating to the >> github issues page. >> >> Any ideas? >> >> Thanks, >> Alex >> >> -- >> This mailing list is governed under the HashiCorp Community Guidelines - >> https://www.hashicorp.com/community-guidelines.html. Behavior in >> violation of those guidelines may result in your removal from this mailing >> list. >> >> GitHub Issues: https://github.com/mitchellh/vagrant/issues >> IRC: #vagrant on Freenode >> --- >> You received this message because you are subscribed to the Google Groups >> "Vagrant" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/vagrant-up/5c002747-81fc-40f0-97ae-fb45f4865176%40googlegroups.com >> <https://groups.google.com/d/msgid/vagrant-up/5c002747-81fc-40f0-97ae-fb45f4865176%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CA%2BonWPdgF_CUg3hQ9oWhJOYZS0SkQ30bF863h2xD7FgLEOzxTw%40mail.gmail.com.
