Docker run failing when mounting host dir inside a container

Question:

I am trying to mount a directory from host to container and at the same time running jupyter from that directory. What am I doing wrong here that docker is complaining as file now found please?

docker run -it –rm -p 8888:8888 tensorflow/tensorflow:nightly-jupyter -v $HOME/mytensor:/tensor –name TensorFlow python:3.9 bash
WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "-v": executable file not found in $PATH: unknown.

I tried removing the version of python but still same problem. I searched extensively online and couldnt get an answer.

Basically i want to mount that directory which is is a git clone where I have tensor files. At the same time, I want to run jupyter notebook where I can see the files and run them. With so many issues with apple:m1 processor and tensorflow, i thought going the docker route would be better but am i not surprised 🙂

Appreciate the help

Answers:

Docker run command syntax is

docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

image name tensorflow/tensorflow:nightly-jupyter should be after options (-v, -p --name et.al.) and before the command.

docker run -it --rm -p 8888:8888 -v $HOME/mytensor:/tensor --name TensorFlow tensorflow/tensorflow:nightly-jupyter bash
Answered By: s3vt