The first argument after the "run" that is not a flag or parameter to a flag is parsed as an image name. When that parsing fails, it tells you the reference format, aka image name (but could be an image id, pinned image, or other syntax) is invalid. In your command:
docker run -p 8888:8888 -v `pwd`/../src:/src -v `pwd`/../data:/data -w /src supervisely_anpr --rm -it bash
The image name "supervisely_anpr" is valid, so you need to look earlier in the command. In this case, the error is most likely from pwd
outputting a path with a space in it. Everything after the space is no longer a parameter to -v
and docker tries to parse it as the image name. The fix is to quote the volume parameters when you cannot guarantee it is free of spaces or other special characters.
When you do that, you'll encounter the next error, "executable not found". Everything after the image name is parsed as the command to run inside the container. In your case, it will try to run the command --rm -it bash
which will almost certainly fail since --rm
will no exist as a binary inside your image. You need to reorder the parameters to resolve that:
docker run --rm -it -p 8888:8888 -v "`pwd`/../src:/src" -v "`pwd`/../data:/data" -w /src supervisely_anpr bash
I've got some more details on these two errors and causes in my slides here: https://sudo-bmitch.github.io/presentations/dc2018/faq-stackoverflow-lightning.html#29
docker run -p 8888:8888 -v "`pwd`/../src":/src -v "`pwd`/../data":/data -w /src --rm -it supervisely_anpr bash
– Tarun Lalwani--rm
and-it
in-betweenrun
and the image name. That won't explain the error message, though. Did you check whether the image name characters don't have any special encoding or upper case? Copy&Paste from your snippet works for me, whiledocker run --rm foo! bash
prints the same error like yours. – gesellix"$(pwd)"
(modern form of"`pwd`"
). Your command becomesdocker run -p 8888:8888 -v "$(pwd)"/../src:/src -v "$(pwd)"/../data:/data -w /src supervisely_anpr --rm -it bash
. – Martin Jambon