volume mount tensorflow container for persistance

2019-08-16 01:36发布

Hi I am trying to get TensorFlow notebook folder mounted to /src/work folder in Ubuntu.

sudo docker run -it -v /src/work:/HOME/notebooks -p 8888:8888 tensorflow/tensorflow:1.3.0

I have tried many combination of -v flags. It is not reading the files already in my work folder or saving new files to it.

2条回答
疯言疯语
2楼-- · 2019-08-16 01:44

This will work as expected. Make sure you have a src folder in the host's root directory (/) eg. you may have ~/repo/src/work this is different than /src/work. In the container, the files will show up exactly on root's /HOME/notebooks directory.

Make sure you are checking the files in the right directory.

查看更多
何必那么认真
3楼-- · 2019-08-16 02:02

You're mounting the volume incorrectly, precisely the path. It should be

-v ~/[absolute path from $HOME]/src/work:~/notebooks/

Explanation:

Since your working directory is /notebooks, which places it at /$HOME/notebooks. You use ~ to get to the $HOME.

查看更多
登录 后发表回答