includes invalid characters for a local volume name,. If you intended to pass a host directory, use absolute path
Asked Answered
H

1

8

I ran docker run -v and it shows error as invalid characters in local volume name.

"If you intended to pass a host directory, use absolute path"

also is printed in the terminal.

Tried replacing -v with --mount but gives error on parameters

sudo docker build -t="sreedath/tensorflow_1.1.0_py3" .

sudo docker run -p 8888:8888 --name=tensorflow_sreedath_py3 -v home/sreedath/Mytest/LSTM-Sentiment-Analysis:/LSTM-Sentiment-Analysis -it sreedath/tensorflow_1.1.0_py3

desired output is to get the localhost at port:8888, but due to error the local host is not working

Hydrastine answered 31/1, 2019 at 9:40 Comment(0)
H
15

The error message is pretty clear :

If you intended to pass a host directory, use absolute path.

You should use absolute path for host directories, otherwise docker consider them as volumes. Here, home/sreedath/Mytest/LSTM-Sentiment-Analysis is considered as a volume, and it contains invalid characters, that's why you get the error.

To mount a host directory (assuming /home/sreedath/Mytest/LSTM-Sentiment-Analysis exists on your host), you should use :

sudo docker run \
    -p 8888:8888 \
    --name=tensorflow_sreedath_py3 \
    -v /home/sreedath/Mytest/LSTM-Sentiment-Analysis:/LSTM-Sentiment-Analysis \
    -it sreedath/tensorflow_1.1.0_py3

Notice the / at the beginning of /home/sreedath/Mytest/LSTM-Sentiment-Analysis (absolute path).

Hydromagnetics answered 31/1, 2019 at 10:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.